{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 数据集构建"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "\n",
    "def loadSimpData():\n",
    "    datMat = np.matrix([[ 1. ,  2.1],\n",
    "                        [ 2.0,  1.1],\n",
    "                        [ 1.3,  1. ],\n",
    "                        [ 1. ,  1. ],\n",
    "                        [ 2. ,  1. ]])\n",
    "    classLabels = [1.0, 1.0, -1.0, -1.0, 1.0]\n",
    "    return datMat,classLabels"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "datMat,classLabels = loadSimpData()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "matrix([[ 1. ,  2.1],\n",
       "        [ 2. ,  1.1],\n",
       "        [ 1.3,  1. ],\n",
       "        [ 1. ,  1. ],\n",
       "        [ 2. ,  1. ]])"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datMat"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1.0, 1.0, -1.0, -1.0, 1.0]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "classLabels"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 单层决策树生成函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def stumpClassify(dataMatrix,dimen,threshVal,threshIneq):\n",
    "    retArray = np.ones((np.shape(dataMatrix)[0],1)) # 初始化retArray为1\n",
    "    if threshIneq == 'lt':\n",
    "        retArray[dataMatrix[:,dimen] <= threshVal] = -1.0 # 如果小于阈值,则赋值为-1\n",
    "    else:\n",
    "        retArray[dataMatrix[:,dimen] > threshVal] = -1.0 # 如果大于阈值,则赋值为-1\n",
    "    return retArray\n",
    "\n",
    "def buildStump(dataArr,classLabels,D):\n",
    "    dataMatrix = np.mat(dataArr); labelMat = np.mat(classLabels).T\n",
    "    m,n = np.shape(dataMatrix)\n",
    "    numSteps = 10.0; bestStump = {}; bestClasEst = np.mat(np.zeros((m,1)))\n",
    "    minError = float('inf') # 最小误差初始化为正无穷大\n",
    "    for i in range(n): # 遍历所有特征\n",
    "        rangeMin = dataMatrix[:,i].min(); rangeMax = dataMatrix[:,i].max() # 找到特征中最小的值和最大值\n",
    "        stepSize = (rangeMax - rangeMin) / numSteps # 计算步长\n",
    "        for j in range(-1, int(numSteps) + 1):                                     \n",
    "            for inequal in ['lt', 'gt']: # 大于和小于的情况，均遍历。lt:less than，gt:greater than\n",
    "                threshVal = (rangeMin + float(j) * stepSize) # 计算阈值\n",
    "                predictedVals = stumpClassify(dataMatrix, i, threshVal, inequal) # 计算分类结果\n",
    "                errArr = np.mat(np.ones((m,1))) # 初始化误差矩阵\n",
    "                errArr[predictedVals == labelMat] = 0 # 分类正确的,赋值为0\n",
    "                weightedError = D.T * errArr # 计算误差\n",
    "                # print(\"split: dim %d, thresh %.2f, thresh ineqal: %s, the weighted error is %.3f\" % (i, threshVal, inequal, weightedError))\n",
    "                if weightedError < minError:  # 找到误差最小的分类方式\n",
    "                    minError = weightedError\n",
    "                    bestClasEst = predictedVals.copy()\n",
    "                    bestStump['dim'] = i\n",
    "                    bestStump['thresh'] = threshVal\n",
    "                    bestStump['ineq'] = inequal\n",
    "    return bestStump, minError, bestClasEst"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "({'dim': 0, 'ineq': 'lt', 'thresh': 1.3}, matrix([[ 0.2]]), array([[-1.],\n",
       "        [ 1.],\n",
       "        [-1.],\n",
       "        [-1.],\n",
       "        [ 1.]]))"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "D = np.mat(np.ones((5, 1)) / 5)\n",
    "buildStump(datMat, classLabels, D)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 基于单层决策树的Adaboost训练过程"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def adaBoostTrainDS(dataArr, classLabels, numIt = 40):\n",
    "    weakClassArr = []\n",
    "    m = np.shape(dataArr)[0]\n",
    "    D = np.mat(np.ones((m, 1)) / m) # 初始化权重\n",
    "    aggClassEst = np.mat(np.zeros((m,1)))\n",
    "    for i in range(numIt):\n",
    "        bestStump, error, classEst = buildStump(dataArr, classLabels, D) # 构建单层决策树\n",
    "        print(\"D:\",D.T)\n",
    "        alpha = float(0.5 * np.log((1.0 - error) / max(error, 1e-16))) # 计算弱学习算法权重alpha,使error不等于0,因为分母不能为0\n",
    "        bestStump['alpha'] = alpha # 存储弱学习算法权重\n",
    "        weakClassArr.append(bestStump) # 存储单层决策树\n",
    "        print(\"classEst: \", classEst.T)\n",
    "        expon = np.multiply(-1 * alpha * np.mat(classLabels).T, classEst) # 计算e的指数项\n",
    "        D = np.multiply(D, np.exp(expon))                                      \n",
    "        D = D / D.sum() #根 据样本权重公式，更新样本权重\n",
    "        # 计算AdaBoost误差，当误差为0的时候，退出循环\n",
    "        aggClassEst += alpha * classEst #计算类别估计累计值                                \n",
    "        print(\"aggClassEst: \", aggClassEst.T)\n",
    "        aggErrors = np.multiply(np.sign(aggClassEst) != np.mat(classLabels).T, np.ones((m,1))) #计算误差\n",
    "        errorRate = aggErrors.sum() / m\n",
    "        print(\"total error: \", errorRate)\n",
    "        if errorRate == 0.0: \n",
    "            break # 误差为0，退出循环\n",
    "    return weakClassArr, aggClassEst"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "D: [[ 0.2  0.2  0.2  0.2  0.2]]\n",
      "classEst:  [[-1.  1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.69314718  0.69314718 -0.69314718 -0.69314718  0.69314718]]\n",
      "total error:  0.2\n",
      "D: [[ 0.5    0.125  0.125  0.125  0.125]]\n",
      "classEst:  [[ 1.  1. -1. -1. -1.]]\n",
      "aggClassEst:  [[ 0.27980789  1.66610226 -1.66610226 -1.66610226 -0.27980789]]\n",
      "total error:  0.2\n",
      "D: [[ 0.28571429  0.07142857  0.07142857  0.07142857  0.5       ]]\n",
      "classEst:  [[ 1.  1.  1.  1.  1.]]\n",
      "aggClassEst:  [[ 1.17568763  2.56198199 -0.77022252 -0.77022252  0.61607184]]\n",
      "total error:  0.0\n"
     ]
    }
   ],
   "source": [
    "classifierArray = adaBoostTrainDS(datMat, classLabels, 9)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "([{'alpha': 0.6931471805599453, 'dim': 0, 'ineq': 'lt', 'thresh': 1.3},\n",
       "  {'alpha': 0.9729550745276565, 'dim': 1, 'ineq': 'lt', 'thresh': 1.0},\n",
       "  {'alpha': 0.8958797346140273,\n",
       "   'dim': 0,\n",
       "   'ineq': 'lt',\n",
       "   'thresh': 0.90000000000000002}],\n",
       " matrix([[ 1.17568763],\n",
       "         [ 2.56198199],\n",
       "         [-0.77022252],\n",
       "         [-0.77022252],\n",
       "         [ 0.61607184]]))"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "classifierArray"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Adaboost分类函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def adaClassify(datToClass,classifierArr):\n",
    "    dataMatrix = np.mat(datToClass)\n",
    "    m = np.shape(dataMatrix)[0]\n",
    "    aggClassEst = np.mat(np.zeros((m,1)))\n",
    "    for i in range(len(classifierArr)): # 遍历所有分类器，进行分类\n",
    "        classEst = stumpClassify(dataMatrix, classifierArr[i]['dim'], classifierArr[i]['thresh'], classifierArr[i]['ineq'])            \n",
    "        aggClassEst += classifierArr[i]['alpha'] * classEst\n",
    "        print(aggClassEst)\n",
    "    return np.sign(aggClassEst)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "D: [[ 0.2  0.2  0.2  0.2  0.2]]\n",
      "classEst:  [[-1.  1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.69314718  0.69314718 -0.69314718 -0.69314718  0.69314718]]\n",
      "total error:  0.2\n",
      "D: [[ 0.5    0.125  0.125  0.125  0.125]]\n",
      "classEst:  [[ 1.  1. -1. -1. -1.]]\n",
      "aggClassEst:  [[ 0.27980789  1.66610226 -1.66610226 -1.66610226 -0.27980789]]\n",
      "total error:  0.2\n",
      "D: [[ 0.28571429  0.07142857  0.07142857  0.07142857  0.5       ]]\n",
      "classEst:  [[ 1.  1.  1.  1.  1.]]\n",
      "aggClassEst:  [[ 1.17568763  2.56198199 -0.77022252 -0.77022252  0.61607184]]\n",
      "total error:  0.0\n"
     ]
    }
   ],
   "source": [
    "datArr, labelArr = loadSimpData()\n",
    "classifierArr, aggClassEst = adaBoostTrainDS(datArr, labelArr, 30)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[-0.69314718]]\n",
      "[[-1.66610226]]\n",
      "[[-2.56198199]]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "matrix([[-1.]])"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "adaClassify([0, 0], classifierArr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 0.69314718]\n",
      " [-0.69314718]]\n",
      "[[ 1.66610226]\n",
      " [-1.66610226]]\n",
      "[[ 2.56198199]\n",
      " [-2.56198199]]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "matrix([[ 1.],\n",
       "        [-1.]])"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "adaClassify([[5, 5], [0, 0]], classifierArr)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 在一个难数据集上应用Adaboost\n",
    "\n",
    "## 自适应数据加载函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def loadDataSet(filename):\n",
    "    numFeat = len(open(filename).readline().split('\\t')) # 读取数据，以制表符分隔\n",
    "    dataMat = []\n",
    "    labelMat = []\n",
    "    fr = open(filename)\n",
    "    for line in fr.readlines():\n",
    "        lineArr = []\n",
    "        curLine = line.strip().split('\\t')\n",
    "        for i in range(numFeat - 1):\n",
    "            lineArr.append(float(curLine[i]))\n",
    "        dataMat.append(lineArr)\n",
    "        labelMat.append(float(curLine[-1]))\n",
    "    return dataMat, labelMat"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "D: [[ 0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448  0.00334448\n",
      "   0.00334448  0.00334448  0.00334448  0.00334448  0.00334448]]\n",
      "classEst:  [[-1.  1.  1.  1.  1.  1.  1.  1. -1. -1.  1.  1.  1.  1.  1. -1. -1.  1.\n",
      "   1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1. -1. -1.\n",
      "   1. -1.  1.  1. -1.  1.  1. -1. -1. -1. -1.  1.  1. -1.  1.  1.  1.  1.\n",
      "   1.  1.  1. -1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1. -1.  1.  1.  1.  1. -1.  1. -1.  1.  1. -1.  1.  1. -1.  1.  1.  1.\n",
      "   1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1. -1.  1.  1.  1.\n",
      "  -1.  1.  1.  1.  1.  1. -1.  1.  1.  1. -1.  1.  1. -1.  1. -1.  1.  1.\n",
      "  -1. -1.  1.  1.  1.  1.  1. -1. -1. -1.  1.  1.  1.  1.  1. -1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.\n",
      "  -1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1. -1. -1. -1. -1.\n",
      "   1. -1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1. -1.  1.  1.  1.  1.  1.\n",
      "   1.  1. -1.  1.  1. -1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1. -1.  1. -1. -1.  1.  1.  1.\n",
      "  -1.  1.  1.  1. -1. -1.  1. -1.  1.  1. -1. -1. -1. -1.  1.  1.  1.  1.\n",
      "  -1. -1. -1.  1.  1.  1.  1. -1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.\n",
      "  -1. -1. -1.  1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.\n",
      "   1.  1.  1. -1.  1.  1.  1. -1. -1.  1.  1.]]\n",
      "aggClassEst:  [[-0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238 -0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238 -0.46166238  0.46166238\n",
      "   0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238 -0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238\n",
      "   0.46166238 -0.46166238 -0.46166238 -0.46166238 -0.46166238  0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238 -0.46166238 -0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238 -0.46166238\n",
      "   0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238\n",
      "   0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238 -0.46166238 -0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238\n",
      "   0.46166238  0.46166238 -0.46166238 -0.46166238 -0.46166238 -0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238 -0.46166238\n",
      "  -0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238\n",
      "   0.46166238 -0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238 -0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238  0.46166238 -0.46166238 -0.46166238\n",
      "  -0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238 -0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238 -0.46166238 -0.46166238  0.46166238 -0.46166238 -0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   0.46166238 -0.46166238 -0.46166238  0.46166238  0.46166238]]\n",
      "total error:  0.284280936455\n",
      "D: [[ 0.00233645  0.00588235  0.00233645  0.00588235  0.00588235  0.00233645\n",
      "   0.00233645  0.00588235  0.00233645  0.00588235  0.00233645  0.00233645\n",
      "   0.00233645  0.00588235  0.00233645  0.00233645  0.00233645  0.00233645\n",
      "   0.00233645  0.00233645  0.00588235  0.00233645  0.00233645  0.00233645\n",
      "   0.00233645  0.00233645  0.00233645  0.00233645  0.00588235  0.00233645\n",
      "   0.00233645  0.00588235  0.00233645  0.00233645  0.00588235  0.00233645\n",
      "   0.00588235  0.00588235  0.00233645  0.00588235  0.00233645  0.00233645\n",
      "   0.00233645  0.00233645  0.00233645  0.00233645  0.00588235  0.00233645\n",
      "   0.00588235  0.00233645  0.00233645  0.00588235  0.00233645  0.00233645\n",
      "   0.00588235  0.00588235  0.00233645  0.00233645  0.00233645  0.00233645\n",
      "   0.00233645  0.00233645  0.00588235  0.00588235  0.00233645  0.00233645\n",
      "   0.00233645  0.00233645  0.00233645  0.00233645  0.00588235  0.00233645\n",
      "   0.00588235  0.00233645  0.00588235  0.00588235  0.00233645  0.00233645\n",
      "   0.00233645  0.00233645  0.00233645  0.00233645  0.00233645  0.00233645\n",
      "   0.00233645  0.00233645  0.00233645  0.00588235  0.00233645  0.00233645\n",
      "   0.00233645  0.00588235  0.00233645  0.00233645  0.00233645  0.00233645\n",
      "   0.00233645  0.00588235  0.00233645  0.00233645  0.00233645  0.00233645\n",
      "   0.00233645  0.00233645  0.00233645  0.00233645  0.00233645  0.00233645\n",
      "   0.00233645  0.00588235  0.00588235  0.00233645  0.00233645  0.00588235\n",
      "   0.00588235  0.00233645  0.00233645  0.00588235  0.00588235  0.00233645\n",
      "   0.00233645  0.00233645  0.00233645  0.00233645  0.00588235  0.00233645\n",
      "   0.00588235  0.00588235  0.00588235  0.00233645  0.00588235  0.00588235\n",
      "   0.00233645  0.00233645  0.00233645  0.00233645  0.00233645  0.00233645\n",
      "   0.00233645  0.00233645  0.00588235  0.00233645  0.00233645  0.00588235\n",
      "   0.00233645  0.00233645  0.00588235  0.00233645  0.00233645  0.00233645\n",
      "   0.00233645  0.00233645  0.00233645  0.00233645  0.00233645  0.00233645\n",
      "   0.00588235  0.00233645  0.00233645  0.00588235  0.00588235  0.00233645\n",
      "   0.00233645  0.00233645  0.00588235  0.00233645  0.00233645  0.00233645\n",
      "   0.00233645  0.00233645  0.00588235  0.00233645  0.00588235  0.00233645\n",
      "   0.00233645  0.00233645  0.00233645  0.00588235  0.00233645  0.00233645\n",
      "   0.00233645  0.00233645  0.00233645  0.00233645  0.00233645  0.00233645\n",
      "   0.00233645  0.00233645  0.00233645  0.00233645  0.00588235  0.00233645\n",
      "   0.00233645  0.00233645  0.00233645  0.00588235  0.00588235  0.00233645\n",
      "   0.00233645  0.00233645  0.00233645  0.00588235  0.00233645  0.00588235\n",
      "   0.00233645  0.00588235  0.00588235  0.00588235  0.00233645  0.00588235\n",
      "   0.00588235  0.00233645  0.00233645  0.00233645  0.00233645  0.00233645\n",
      "   0.00233645  0.00588235  0.00233645  0.00233645  0.00233645  0.00233645\n",
      "   0.00233645  0.00233645  0.00233645  0.00588235  0.00233645  0.00233645\n",
      "   0.00233645  0.00588235  0.00233645  0.00233645  0.00233645  0.00233645\n",
      "   0.00233645  0.00233645  0.00233645  0.00588235  0.00233645  0.00233645\n",
      "   0.00233645  0.00233645  0.00233645  0.00233645  0.00233645  0.00588235\n",
      "   0.00233645  0.00588235  0.00233645  0.00588235  0.00588235  0.00588235\n",
      "   0.00588235  0.00588235  0.00233645  0.00588235  0.00588235  0.00233645\n",
      "   0.00588235  0.00588235  0.00233645  0.00233645  0.00233645  0.00233645\n",
      "   0.00588235  0.00233645  0.00233645  0.00233645  0.00233645  0.00588235\n",
      "   0.00588235  0.00588235  0.00233645  0.00588235  0.00233645  0.00233645\n",
      "   0.00233645  0.00233645  0.00233645  0.00233645  0.00588235  0.00588235\n",
      "   0.00233645  0.00233645  0.00233645  0.00233645  0.00233645  0.00233645\n",
      "   0.00233645  0.00233645  0.00588235  0.00233645  0.00588235  0.00233645\n",
      "   0.00588235  0.00233645  0.00233645  0.00233645  0.00588235]]\n",
      "classEst:  [[ 1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.\n",
      "   1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1.\n",
      "   1. -1.  1.  1. -1.  1.  1.  1. -1. -1. -1.  1. -1. -1.  1.  1.  1.  1.\n",
      "  -1.  1.  1.  1. -1. -1.  1.  1. -1. -1.  1.  1. -1.  1. -1.  1.  1.  1.\n",
      "   1. -1.  1.  1.  1.  1.  1. -1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.\n",
      "  -1. -1.  1.  1.  1.  1.  1. -1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "  -1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1. -1. -1.  1. -1.\n",
      "   1.  1.  1. -1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1. -1.  1.  1. -1.  1.  1. -1. -1. -1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1. -1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1. -1. -1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "  -1.  1.  1.  1.  1. -1.  1.  1.  1. -1.  1. -1.  1.  1. -1.  1.  1.  1.\n",
      "  -1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1.\n",
      "   1.  1.  1.  1. -1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1. -1.  1.  1.  1.  1.  1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1. -1.  1.  1.  1. -1.  1. -1.  1.  1.]]\n",
      "aggClassEst:  [[-0.14917993  0.77414483  0.77414483  0.77414483  0.14917993  0.77414483\n",
      "   0.77414483  0.77414483 -0.14917993 -0.14917993  0.77414483  0.77414483\n",
      "   0.77414483  0.77414483  0.77414483 -0.14917993 -0.77414483  0.77414483\n",
      "   0.77414483  0.14917993 -0.14917993  0.77414483  0.77414483  0.77414483\n",
      "   0.77414483  0.77414483  0.77414483  0.77414483  0.77414483  0.77414483\n",
      "  -0.77414483  0.77414483  0.77414483  0.77414483 -0.14917993 -0.77414483\n",
      "   0.77414483 -0.77414483  0.77414483  0.77414483 -0.77414483  0.77414483\n",
      "   0.77414483 -0.14917993 -0.77414483 -0.77414483 -0.77414483  0.77414483\n",
      "   0.14917993 -0.77414483  0.77414483  0.77414483  0.77414483  0.77414483\n",
      "   0.14917993  0.77414483  0.77414483 -0.14917993 -0.77414483 -0.77414483\n",
      "   0.77414483  0.77414483  0.14917993  0.14917993  0.77414483  0.77414483\n",
      "   0.14917993  0.77414483  0.14917993  0.77414483  0.77414483  0.77414483\n",
      "   0.77414483 -0.77414483  0.77414483  0.77414483  0.77414483  0.77414483\n",
      "  -0.14917993  0.14917993 -0.14917993  0.77414483  0.77414483 -0.77414483\n",
      "   0.77414483  0.77414483 -0.14917993  0.77414483  0.77414483  0.77414483\n",
      "   0.14917993  0.14917993  0.77414483 -0.14917993  0.77414483  0.77414483\n",
      "   0.77414483  0.14917993  0.77414483  0.14917993  0.77414483 -0.14917993\n",
      "   0.77414483  0.77414483 -0.14917993  0.77414483  0.77414483  0.77414483\n",
      "  -0.77414483  0.77414483  0.14917993  0.77414483  0.77414483  0.77414483\n",
      "  -0.14917993  0.77414483  0.77414483  0.77414483 -0.14917993  0.77414483\n",
      "   0.77414483 -0.77414483  0.77414483 -0.14917993  0.77414483  0.77414483\n",
      "  -0.14917993 -0.14917993  0.77414483  0.77414483  0.77414483  0.77414483\n",
      "   0.77414483 -0.77414483 -0.14917993 -0.14917993  0.77414483  0.77414483\n",
      "   0.77414483  0.77414483  0.14917993 -0.77414483  0.77414483  0.14917993\n",
      "   0.77414483  0.77414483  0.77414483  0.14917993  0.77414483  0.77414483\n",
      "  -0.77414483  0.14917993  0.77414483  0.77414483  0.77414483  0.77414483\n",
      "   0.77414483  0.77414483  0.77414483 -0.14917993  0.77414483  0.77414483\n",
      "  -0.14917993  0.77414483  0.14917993  0.77414483  0.77414483  0.14917993\n",
      "  -0.14917993  0.77414483  0.14917993  0.14917993  0.14917993 -0.14917993\n",
      "   0.77414483  0.77414483 -0.14917993 -0.14917993 -0.14917993 -0.14917993\n",
      "   0.77414483 -0.77414483  0.77414483  0.77414483  0.14917993  0.77414483\n",
      "   0.77414483  0.77414483  0.77414483  0.77414483 -0.14917993  0.77414483\n",
      "  -0.77414483  0.77414483  0.77414483  0.14917993  0.14917993  0.77414483\n",
      "   0.77414483  0.77414483 -0.14917993  0.77414483  0.77414483 -0.14917993\n",
      "  -0.14917993 -0.14917993  0.77414483  0.14917993  0.77414483  0.77414483\n",
      "   0.77414483  0.77414483  0.77414483  0.77414483  0.77414483  0.77414483\n",
      "   0.14917993  0.77414483  0.77414483 -0.14917993  0.77414483  0.14917993\n",
      "   0.77414483  0.77414483  0.77414483  0.14917993  0.77414483 -0.77414483\n",
      "   0.77414483 -0.14917993 -0.77414483  0.77414483  0.77414483  0.77414483\n",
      "  -0.77414483  0.77414483  0.77414483  0.77414483 -0.14917993 -0.77414483\n",
      "   0.77414483 -0.14917993  0.77414483  0.77414483 -0.77414483 -0.14917993\n",
      "  -0.14917993 -0.14917993  0.77414483  0.14917993  0.77414483  0.77414483\n",
      "  -0.14917993 -0.14917993 -0.14917993  0.77414483  0.14917993  0.77414483\n",
      "   0.14917993 -0.14917993  0.77414483  0.77414483 -0.14917993  0.77414483\n",
      "   0.77414483  0.77414483  0.77414483  0.77414483  0.77414483  0.77414483\n",
      "  -0.14917993 -0.14917993 -0.77414483  0.77414483 -0.14917993 -0.14917993\n",
      "   0.77414483  0.77414483  0.77414483  0.77414483  0.14917993  0.14917993\n",
      "   0.77414483  0.77414483  0.77414483 -0.14917993  0.77414483  0.77414483\n",
      "   0.77414483  0.77414483  0.14917993 -0.14917993  0.77414483  0.77414483\n",
      "   0.14917993 -0.14917993 -0.77414483  0.77414483  0.77414483]]\n",
      "total error:  0.284280936455\n",
      "D: [[ 0.00335068  0.00843582  0.00179355  0.00843582  0.00451553  0.00179355\n",
      "   0.00179355  0.00843582  0.00335068  0.00451553  0.00179355  0.00179355\n",
      "   0.00179355  0.00843582  0.00179355  0.00335068  0.00179355  0.00179355\n",
      "   0.00179355  0.00335068  0.00451553  0.00179355  0.00179355  0.00179355\n",
      "   0.00179355  0.00179355  0.00179355  0.00179355  0.00843582  0.00179355\n",
      "   0.00179355  0.00843582  0.00179355  0.00179355  0.00451553  0.00179355\n",
      "   0.00843582  0.00843582  0.00179355  0.00843582  0.00179355  0.00179355\n",
      "   0.00179355  0.00335068  0.00179355  0.00179355  0.00843582  0.00179355\n",
      "   0.00451553  0.00179355  0.00179355  0.00843582  0.00179355  0.00179355\n",
      "   0.00451553  0.00843582  0.00179355  0.00335068  0.00179355  0.00179355\n",
      "   0.00179355  0.00179355  0.00451553  0.00451553  0.00179355  0.00179355\n",
      "   0.00335068  0.00179355  0.00335068  0.00179355  0.00843582  0.00179355\n",
      "   0.00843582  0.00179355  0.00843582  0.00843582  0.00179355  0.00179355\n",
      "   0.00335068  0.00335068  0.00335068  0.00179355  0.00179355  0.00179355\n",
      "   0.00179355  0.00179355  0.00335068  0.00843582  0.00179355  0.00179355\n",
      "   0.00335068  0.00451553  0.00179355  0.00335068  0.00179355  0.00179355\n",
      "   0.00179355  0.00451553  0.00179355  0.00335068  0.00179355  0.00335068\n",
      "   0.00179355  0.00179355  0.00335068  0.00179355  0.00179355  0.00179355\n",
      "   0.00179355  0.00843582  0.00451553  0.00179355  0.00179355  0.00843582\n",
      "   0.00451553  0.00179355  0.00179355  0.00843582  0.00451553  0.00179355\n",
      "   0.00179355  0.00179355  0.00179355  0.00335068  0.00843582  0.00179355\n",
      "   0.00451553  0.00451553  0.00843582  0.00179355  0.00843582  0.00843582\n",
      "   0.00179355  0.00179355  0.00335068  0.00335068  0.00179355  0.00179355\n",
      "   0.00179355  0.00179355  0.00451553  0.00179355  0.00179355  0.00451553\n",
      "   0.00179355  0.00179355  0.00843582  0.00335068  0.00179355  0.00179355\n",
      "   0.00179355  0.00335068  0.00179355  0.00179355  0.00179355  0.00179355\n",
      "   0.00843582  0.00179355  0.00179355  0.00451553  0.00843582  0.00179355\n",
      "   0.00335068  0.00179355  0.00451553  0.00179355  0.00179355  0.00335068\n",
      "   0.00335068  0.00179355  0.00451553  0.00335068  0.00451553  0.00335068\n",
      "   0.00179355  0.00179355  0.00335068  0.00451553  0.00335068  0.00335068\n",
      "   0.00179355  0.00179355  0.00179355  0.00179355  0.00335068  0.00179355\n",
      "   0.00179355  0.00179355  0.00179355  0.00179355  0.00451553  0.00179355\n",
      "   0.00179355  0.00179355  0.00179355  0.00451553  0.00451553  0.00179355\n",
      "   0.00179355  0.00179355  0.00335068  0.00843582  0.00179355  0.00451553\n",
      "   0.00335068  0.00451553  0.00843582  0.00451553  0.00179355  0.00843582\n",
      "   0.00843582  0.00179355  0.00179355  0.00179355  0.00179355  0.00179355\n",
      "   0.00335068  0.00843582  0.00179355  0.00335068  0.00179355  0.00335068\n",
      "   0.00179355  0.00179355  0.00179355  0.00451553  0.00179355  0.00179355\n",
      "   0.00179355  0.00451553  0.00179355  0.00179355  0.00179355  0.00179355\n",
      "   0.00179355  0.00179355  0.00179355  0.00843582  0.00335068  0.00179355\n",
      "   0.00179355  0.00335068  0.00179355  0.00179355  0.00179355  0.00451553\n",
      "   0.00335068  0.00451553  0.00179355  0.00451553  0.00843582  0.00843582\n",
      "   0.00451553  0.00451553  0.00335068  0.00843582  0.00451553  0.00179355\n",
      "   0.00451553  0.00451553  0.00179355  0.00179355  0.00335068  0.00179355\n",
      "   0.00843582  0.00179355  0.00179355  0.00179355  0.00179355  0.00843582\n",
      "   0.00451553  0.00451553  0.00179355  0.00843582  0.00335068  0.00335068\n",
      "   0.00179355  0.00179355  0.00179355  0.00179355  0.00451553  0.00451553\n",
      "   0.00179355  0.00179355  0.00179355  0.00335068  0.00179355  0.00179355\n",
      "   0.00179355  0.00179355  0.00451553  0.00335068  0.00843582  0.00179355\n",
      "   0.00451553  0.00335068  0.00179355  0.00179355  0.00843582]]\n",
      "classEst:  [[-1. -1.  1. -1. -1.  1.  1. -1. -1. -1. -1. -1.  1. -1. -1. -1. -1.  1.\n",
      "  -1. -1. -1.  1.  1. -1. -1. -1. -1.  1.  1.  1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1.  1. -1. -1. -1. -1. -1. -1. -1. -1.  1. -1. -1.  1. -1.  1.  1.\n",
      "  -1. -1.  1. -1.  1. -1.  1. -1. -1. -1. -1. -1. -1.  1.  1.  1. -1.  1.\n",
      "  -1.  1.  1. -1.  1.  1.  1. -1. -1.  1. -1.  1. -1.  1. -1.  1. -1.  1.\n",
      "   1. -1.  1.  1.  1.  1. -1. -1.  1. -1.  1. -1.  1. -1.  1. -1.  1.  1.\n",
      "  -1. -1. -1.  1.  1. -1.  1.  1.  1.  1. -1. -1.  1. -1.  1. -1.  1.  1.\n",
      "   1.  1. -1.  1.  1. -1.  1. -1. -1.  1.  1. -1. -1.  1.  1. -1.  1. -1.\n",
      "  -1.  1.  1. -1.  1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1.\n",
      "  -1. -1. -1.  1.  1. -1. -1.  1. -1. -1. -1.  1.  1. -1. -1. -1. -1. -1.\n",
      "   1.  1. -1. -1. -1. -1. -1. -1. -1.  1. -1.  1. -1. -1.  1. -1. -1. -1.\n",
      "  -1.  1. -1.  1.  1.  1. -1. -1.  1. -1.  1. -1. -1. -1.  1. -1.  1.  1.\n",
      "  -1.  1.  1. -1. -1. -1. -1.  1.  1. -1.  1. -1. -1. -1. -1.  1. -1.  1.\n",
      "   1.  1.  1. -1. -1. -1.  1.  1. -1. -1. -1. -1. -1. -1.  1. -1.  1. -1.\n",
      "  -1. -1. -1. -1. -1.  1. -1.  1.  1. -1. -1.  1. -1. -1.  1.  1. -1. -1.\n",
      "  -1. -1. -1. -1. -1.  1.  1.  1. -1.  1. -1. -1. -1.  1. -1. -1. -1.  1.\n",
      "   1.  1. -1. -1. -1.  1. -1. -1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.43598966  0.4873351   1.06095456  0.4873351  -0.1376298   1.06095456\n",
      "   1.06095456  0.4873351  -0.43598966 -0.43598966  0.4873351   0.4873351\n",
      "   1.06095456  0.4873351   0.4873351  -0.43598966 -1.06095456  1.06095456\n",
      "   0.4873351  -0.1376298  -0.43598966  1.06095456  1.06095456  0.4873351\n",
      "   0.4873351   0.4873351   0.4873351   1.06095456  1.06095456  1.06095456\n",
      "  -1.06095456  0.4873351   0.4873351   0.4873351  -0.43598966 -1.06095456\n",
      "   0.4873351  -1.06095456  1.06095456  0.4873351  -1.06095456  0.4873351\n",
      "   0.4873351  -0.43598966 -1.06095456 -1.06095456 -1.06095456  1.06095456\n",
      "  -0.1376298  -1.06095456  1.06095456  0.4873351   1.06095456  1.06095456\n",
      "  -0.1376298   0.4873351   1.06095456 -0.43598966 -0.4873351  -1.06095456\n",
      "   1.06095456  0.4873351  -0.1376298  -0.1376298   0.4873351   0.4873351\n",
      "  -0.1376298   1.06095456  0.43598966  1.06095456  0.4873351   1.06095456\n",
      "   0.4873351  -0.4873351   1.06095456  0.4873351   1.06095456  1.06095456\n",
      "   0.1376298  -0.1376298  -0.43598966  1.06095456  0.4873351  -0.4873351\n",
      "   0.4873351   1.06095456 -0.43598966  1.06095456  0.4873351   1.06095456\n",
      "   0.43598966 -0.1376298   1.06095456  0.1376298   1.06095456  1.06095456\n",
      "   0.4873351  -0.1376298   1.06095456 -0.1376298   1.06095456 -0.43598966\n",
      "   1.06095456  0.4873351   0.1376298   0.4873351   1.06095456  1.06095456\n",
      "  -1.06095456  0.4873351  -0.1376298   1.06095456  1.06095456  0.4873351\n",
      "   0.1376298   1.06095456  1.06095456  1.06095456 -0.43598966  0.4873351\n",
      "   1.06095456 -1.06095456  1.06095456 -0.43598966  1.06095456  1.06095456\n",
      "   0.1376298   0.1376298   0.4873351   1.06095456  1.06095456  0.4873351\n",
      "   1.06095456 -1.06095456 -0.43598966  0.1376298   1.06095456  0.4873351\n",
      "   0.4873351   1.06095456  0.43598966 -1.06095456  1.06095456 -0.1376298\n",
      "   0.4873351   1.06095456  1.06095456 -0.1376298   1.06095456  1.06095456\n",
      "  -0.4873351  -0.1376298   1.06095456  1.06095456  1.06095456  1.06095456\n",
      "   0.4873351   1.06095456  1.06095456  0.1376298   1.06095456  0.4873351\n",
      "  -0.43598966  0.4873351  -0.1376298   1.06095456  1.06095456 -0.1376298\n",
      "  -0.43598966  1.06095456 -0.1376298  -0.1376298  -0.1376298   0.1376298\n",
      "   1.06095456  0.4873351  -0.43598966 -0.43598966 -0.43598966 -0.43598966\n",
      "   1.06095456 -0.4873351   0.4873351   0.4873351  -0.1376298   0.4873351\n",
      "   0.4873351   0.4873351   0.4873351   1.06095456 -0.43598966  1.06095456\n",
      "  -1.06095456  0.4873351   1.06095456 -0.1376298  -0.1376298   0.4873351\n",
      "   0.4873351   1.06095456 -0.43598966  1.06095456  1.06095456  0.1376298\n",
      "  -0.43598966 -0.43598966  1.06095456 -0.1376298   1.06095456  0.4873351\n",
      "   0.4873351   0.4873351   1.06095456  0.4873351   1.06095456  1.06095456\n",
      "  -0.1376298   1.06095456  1.06095456 -0.43598966  0.4873351  -0.1376298\n",
      "   0.4873351   1.06095456  1.06095456 -0.1376298   1.06095456 -1.06095456\n",
      "   0.4873351  -0.43598966 -1.06095456  1.06095456  0.4873351   1.06095456\n",
      "  -0.4873351   1.06095456  1.06095456  0.4873351  -0.43598966 -1.06095456\n",
      "   1.06095456  0.1376298   0.4873351   0.4873351  -1.06095456 -0.43598966\n",
      "  -0.43598966 -0.43598966  1.06095456 -0.1376298   1.06095456  0.4873351\n",
      "  -0.43598966 -0.43598966 -0.43598966  0.4873351  -0.1376298   1.06095456\n",
      "  -0.1376298   0.1376298   1.06095456  0.4873351  -0.43598966  1.06095456\n",
      "   0.4873351   0.4873351   1.06095456  1.06095456  0.4873351   0.4873351\n",
      "  -0.43598966 -0.43598966 -1.06095456  0.4873351  -0.43598966  0.1376298\n",
      "   1.06095456  1.06095456  0.4873351   1.06095456 -0.1376298  -0.1376298\n",
      "   0.4873351   1.06095456  0.4873351  -0.43598966  0.4873351   1.06095456\n",
      "   1.06095456  1.06095456 -0.1376298  -0.43598966  0.4873351   1.06095456\n",
      "  -0.1376298  -0.43598966 -1.06095456  0.4873351   1.06095456]]\n",
      "total error:  0.247491638796\n",
      "D: [[ 0.00261936  0.00659463  0.00140209  0.00659463  0.00352998  0.00140209\n",
      "   0.00140209  0.00659463  0.00261936  0.00626457  0.00248826  0.00248826\n",
      "   0.00140209  0.00659463  0.00248826  0.00261936  0.00140209  0.00140209\n",
      "   0.00248826  0.00464853  0.00626457  0.00140209  0.00140209  0.00248826\n",
      "   0.00248826  0.00248826  0.00248826  0.00140209  0.01170335  0.00140209\n",
      "   0.00140209  0.00659463  0.00248826  0.00248826  0.00626457  0.00140209\n",
      "   0.00659463  0.01170335  0.00140209  0.00659463  0.00140209  0.00248826\n",
      "   0.00248826  0.00261936  0.00140209  0.00140209  0.01170335  0.00140209\n",
      "   0.00352998  0.00140209  0.00140209  0.00659463  0.00140209  0.00140209\n",
      "   0.00352998  0.00659463  0.00140209  0.00261936  0.00248826  0.00140209\n",
      "   0.00140209  0.00248826  0.00352998  0.00352998  0.00248826  0.00248826\n",
      "   0.00464853  0.00140209  0.00261936  0.00140209  0.00659463  0.00140209\n",
      "   0.00659463  0.00248826  0.01170335  0.00659463  0.00140209  0.00140209\n",
      "   0.00464853  0.00464853  0.00261936  0.00140209  0.00248826  0.00248826\n",
      "   0.00248826  0.00140209  0.00261936  0.01170335  0.00248826  0.00140209\n",
      "   0.00261936  0.00352998  0.00140209  0.00464853  0.00140209  0.00140209\n",
      "   0.00248826  0.00352998  0.00140209  0.00464853  0.00140209  0.00261936\n",
      "   0.00140209  0.00248826  0.00464853  0.00248826  0.00140209  0.00140209\n",
      "   0.00140209  0.00659463  0.00352998  0.00140209  0.00140209  0.00659463\n",
      "   0.00352998  0.00140209  0.00140209  0.01170335  0.00626457  0.00248826\n",
      "   0.00140209  0.00140209  0.00140209  0.00261936  0.01170335  0.00140209\n",
      "   0.00352998  0.00352998  0.00659463  0.00140209  0.01170335  0.00659463\n",
      "   0.00140209  0.00140209  0.00261936  0.00464853  0.00140209  0.00248826\n",
      "   0.00248826  0.00140209  0.00626457  0.00140209  0.00140209  0.00352998\n",
      "   0.00248826  0.00140209  0.01170335  0.00464853  0.00140209  0.00140209\n",
      "   0.00248826  0.00464853  0.00140209  0.00140209  0.00140209  0.00140209\n",
      "   0.00659463  0.00140209  0.00140209  0.00352998  0.01170335  0.00248826\n",
      "   0.00261936  0.00248826  0.00352998  0.00140209  0.00140209  0.00464853\n",
      "   0.00261936  0.00140209  0.00352998  0.00464853  0.00352998  0.00464853\n",
      "   0.00140209  0.00248826  0.00261936  0.00626457  0.00261936  0.00261936\n",
      "   0.00140209  0.00248826  0.00248826  0.00248826  0.00464853  0.00248826\n",
      "   0.00248826  0.00248826  0.00248826  0.00140209  0.00626457  0.00140209\n",
      "   0.00140209  0.00248826  0.00140209  0.00352998  0.00352998  0.00248826\n",
      "   0.00248826  0.00140209  0.00261936  0.01170335  0.00140209  0.00352998\n",
      "   0.00261936  0.00626457  0.01170335  0.00352998  0.00140209  0.00659463\n",
      "   0.00659463  0.00248826  0.00140209  0.00248826  0.00140209  0.00140209\n",
      "   0.00464853  0.01170335  0.00140209  0.00261936  0.00248826  0.00464853\n",
      "   0.00248826  0.00140209  0.00140209  0.00352998  0.00140209  0.00140209\n",
      "   0.00248826  0.00626457  0.00140209  0.00140209  0.00248826  0.00140209\n",
      "   0.00248826  0.00140209  0.00140209  0.00659463  0.00261936  0.00140209\n",
      "   0.00140209  0.00464853  0.00248826  0.00248826  0.00140209  0.00626457\n",
      "   0.00261936  0.00626457  0.00140209  0.00352998  0.01170335  0.00659463\n",
      "   0.00626457  0.00626457  0.00261936  0.00659463  0.00352998  0.00140209\n",
      "   0.00352998  0.00352998  0.00140209  0.00248826  0.00261936  0.00140209\n",
      "   0.00659463  0.00248826  0.00140209  0.00140209  0.00248826  0.00659463\n",
      "   0.00626457  0.00626457  0.00140209  0.00659463  0.00261936  0.00464853\n",
      "   0.00140209  0.00140209  0.00248826  0.00140209  0.00352998  0.00352998\n",
      "   0.00248826  0.00140209  0.00248826  0.00261936  0.00248826  0.00140209\n",
      "   0.00140209  0.00140209  0.00352998  0.00261936  0.00659463  0.00140209\n",
      "   0.00352998  0.00261936  0.00140209  0.00248826  0.01170335]]\n",
      "classEst:  [[-1.  1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1.  1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1.  1.  1. -1. -1. -1. -1.  1. -1. -1. -1. -1. -1. -1.\n",
      "  -1.  1. -1. -1. -1. -1. -1.  1.  1. -1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1. -1. -1. -1. -1.  1. -1.  1.  1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1.  1.  1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "   1. -1. -1. -1. -1.  1. -1. -1. -1. -1.  1. -1. -1. -1. -1. -1. -1. -1.\n",
      "   1. -1. -1. -1. -1. -1.  1.  1.  1. -1.  1.  1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1.  1. -1. -1. -1. -1. -1.  1.\n",
      "   1.  1. -1. -1.  1.  1. -1.  1. -1.  1. -1. -1.  1. -1. -1. -1. -1. -1.\n",
      "  -1. -1.  1. -1. -1. -1. -1. -1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1.\n",
      "  -1. -1.  1.  1. -1. -1. -1. -1. -1. -1. -1.  1. -1. -1.  1. -1. -1.  1.\n",
      "  -1. -1. -1. -1. -1. -1. -1.  1. -1.  1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1.  1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1.  1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "  -1.  1. -1.  1. -1. -1. -1.  1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1.  1. -1. -1. -1.  1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1.  1.  1. -1. -1. -1. -1.]]\n",
      "aggClassEst:  [[-0.66895971  0.72030514  0.82798452  0.25436505 -0.37059985  0.82798452\n",
      "   0.82798452  0.25436505 -0.66895971 -0.66895971  0.25436505  0.25436505\n",
      "   0.82798452  0.25436505  0.72030514 -0.66895971 -1.29392461  0.82798452\n",
      "   0.25436505 -0.37059985 -0.66895971  0.82798452  0.82798452  0.72030514\n",
      "   0.72030514  0.25436505  0.25436505  0.82798452  0.82798452  1.29392461\n",
      "  -1.29392461  0.25436505  0.25436505  0.25436505 -0.66895971 -1.29392461\n",
      "   0.25436505 -0.82798452  0.82798452  0.25436505 -1.29392461  0.25436505\n",
      "   0.25436505 -0.20301961 -0.82798452 -1.29392461 -1.29392461  0.82798452\n",
      "  -0.37059985 -1.29392461  0.82798452  0.25436505  0.82798452  0.82798452\n",
      "  -0.37059985  0.25436505  0.82798452 -0.66895971 -0.72030514 -1.29392461\n",
      "   0.82798452  0.25436505 -0.37059985  0.09534024  0.25436505  0.72030514\n",
      "   0.09534024  0.82798452  0.20301961  0.82798452  0.25436505  0.82798452\n",
      "   0.25436505 -0.72030514  0.82798452  0.25436505  1.29392461  1.29392461\n",
      "  -0.09534024 -0.37059985 -0.66895971  0.82798452  0.25436505 -0.72030514\n",
      "   0.25436505  0.82798452 -0.66895971  0.82798452  0.25436505  0.82798452\n",
      "   0.66895971 -0.37059985  0.82798452 -0.09534024  0.82798452  1.29392461\n",
      "   0.25436505 -0.37059985  0.82798452 -0.37059985  1.29392461 -0.66895971\n",
      "   0.82798452  0.25436505 -0.09534024  0.25436505  0.82798452  0.82798452\n",
      "  -0.82798452  0.25436505 -0.37059985  0.82798452  0.82798452  0.25436505\n",
      "   0.37059985  1.29392461  1.29392461  0.82798452 -0.20301961  0.72030514\n",
      "   0.82798452 -1.29392461  0.82798452 -0.66895971  0.82798452  0.82798452\n",
      "  -0.09534024 -0.09534024  0.25436505  0.82798452  0.82798452  0.25436505\n",
      "   0.82798452 -1.29392461 -0.66895971 -0.09534024  0.82798452  0.72030514\n",
      "   0.25436505  0.82798452  0.20301961 -1.29392461  0.82798452  0.09534024\n",
      "   0.72030514  1.29392461  0.82798452 -0.37059985  1.29392461  1.29392461\n",
      "  -0.72030514  0.09534024  0.82798452  1.29392461  0.82798452  0.82798452\n",
      "   0.72030514  0.82798452  0.82798452 -0.09534024  0.82798452  0.25436505\n",
      "  -0.66895971  0.25436505  0.09534024  0.82798452  0.82798452 -0.37059985\n",
      "  -0.66895971  0.82798452 -0.37059985  0.09534024 -0.37059985 -0.09534024\n",
      "   0.82798452  0.72030514 -0.66895971 -0.20301961 -0.66895971 -0.66895971\n",
      "   0.82798452 -0.72030514  0.72030514  0.72030514 -0.37059985  0.25436505\n",
      "   0.25436505  0.25436505  0.25436505  0.82798452 -0.66895971  1.29392461\n",
      "  -1.29392461  0.25436505  1.29392461 -0.37059985 -0.37059985  0.72030514\n",
      "   0.25436505  0.82798452 -0.66895971  0.82798452  0.82798452 -0.09534024\n",
      "  -0.66895971 -0.20301961  0.82798452  0.09534024  0.82798452  0.25436505\n",
      "   0.25436505  0.25436505  0.82798452  0.25436505  0.82798452  0.82798452\n",
      "  -0.37059985  0.82798452  0.82798452 -0.66895971  0.72030514 -0.37059985\n",
      "   0.25436505  0.82798452  0.82798452 -0.37059985  0.82798452 -1.29392461\n",
      "   0.25436505 -0.66895971 -1.29392461  0.82798452  0.25436505  0.82798452\n",
      "  -0.72030514  0.82798452  0.82798452  0.25436505 -0.20301961 -1.29392461\n",
      "   0.82798452 -0.09534024  0.25436505  0.25436505 -1.29392461 -0.66895971\n",
      "  -0.66895971 -0.66895971  0.82798452 -0.37059985  0.82798452  0.25436505\n",
      "  -0.66895971 -0.20301961 -0.66895971  0.72030514 -0.37059985  0.82798452\n",
      "  -0.37059985  0.37059985  0.82798452  0.25436505 -0.66895971  0.82798452\n",
      "   0.25436505  0.25436505  0.82798452  0.82798452  0.25436505  0.25436505\n",
      "  -0.66895971 -0.66895971 -1.29392461  0.25436505 -0.66895971  0.37059985\n",
      "   0.82798452  0.82798452  0.25436505  1.29392461 -0.37059985 -0.37059985\n",
      "   0.25436505  0.82798452  0.25436505 -0.66895971  0.25436505  0.82798452\n",
      "   0.82798452  0.82798452 -0.37059985 -0.66895971  0.25436505  1.29392461\n",
      "   0.09534024 -0.66895971 -1.29392461  0.25436505  0.82798452]]\n",
      "total error:  0.247491638796\n",
      "D: [[ 0.00213157  0.00855163  0.00181817  0.00536653  0.0028726   0.00181817\n",
      "   0.00181817  0.00536653  0.00213157  0.00812362  0.00322667  0.00322667\n",
      "   0.00181817  0.00536653  0.00202488  0.00213157  0.00114098  0.00181817\n",
      "   0.00322667  0.00602801  0.00812362  0.00181817  0.00181817  0.00202488\n",
      "   0.00202488  0.00322667  0.00322667  0.00181817  0.00952387  0.00114098\n",
      "   0.00114098  0.00536653  0.00322667  0.00322667  0.00812362  0.00114098\n",
      "   0.00536653  0.00952387  0.00181817  0.00536653  0.00114098  0.00322667\n",
      "   0.00322667  0.00339667  0.00181817  0.00114098  0.01517639  0.00181817\n",
      "   0.0028726   0.00114098  0.00181817  0.00536653  0.00181817  0.00181817\n",
      "   0.0028726   0.00536653  0.00181817  0.00213157  0.00202488  0.00114098\n",
      "   0.00181817  0.00322667  0.0028726   0.00457752  0.00322667  0.00202488\n",
      "   0.00378284  0.00181817  0.00339667  0.00181817  0.00536653  0.00181817\n",
      "   0.00536653  0.00202488  0.00952387  0.00536653  0.00114098  0.00114098\n",
      "   0.00378284  0.00602801  0.00213157  0.00181817  0.00322667  0.00202488\n",
      "   0.00322667  0.00181817  0.00213157  0.00952387  0.00322667  0.00181817\n",
      "   0.00213157  0.0028726   0.00181817  0.00378284  0.00181817  0.00114098\n",
      "   0.00322667  0.0028726   0.00181817  0.00602801  0.00114098  0.00213157\n",
      "   0.00181817  0.00322667  0.00378284  0.00322667  0.00181817  0.00181817\n",
      "   0.00181817  0.00536653  0.0028726   0.00181817  0.00181817  0.00536653\n",
      "   0.0028726   0.00114098  0.00114098  0.00952387  0.00509794  0.00202488\n",
      "   0.00181817  0.00114098  0.00181817  0.00213157  0.00952387  0.00181817\n",
      "   0.00457752  0.00457752  0.00536653  0.00181817  0.00952387  0.00536653\n",
      "   0.00181817  0.00114098  0.00213157  0.00378284  0.00181817  0.00202488\n",
      "   0.00322667  0.00181817  0.00509794  0.00114098  0.00181817  0.00457752\n",
      "   0.00202488  0.00114098  0.00952387  0.00602801  0.00114098  0.00114098\n",
      "   0.00202488  0.00378284  0.00181817  0.00114098  0.00181817  0.00181817\n",
      "   0.00855163  0.00181817  0.00181817  0.00457752  0.00952387  0.00322667\n",
      "   0.00213157  0.00322667  0.00457752  0.00181817  0.00181817  0.00602801\n",
      "   0.00213157  0.00181817  0.0028726   0.00378284  0.0028726   0.00378284\n",
      "   0.00181817  0.00202488  0.00213157  0.00509794  0.00213157  0.00213157\n",
      "   0.00181817  0.00202488  0.00202488  0.00202488  0.00602801  0.00322667\n",
      "   0.00322667  0.00322667  0.00322667  0.00181817  0.00812362  0.00114098\n",
      "   0.00114098  0.00322667  0.00114098  0.0028726   0.0028726   0.00202488\n",
      "   0.00322667  0.00181817  0.00213157  0.00952387  0.00181817  0.00457752\n",
      "   0.00213157  0.00509794  0.00952387  0.00457752  0.00181817  0.00536653\n",
      "   0.00536653  0.00322667  0.00181817  0.00322667  0.00181817  0.00181817\n",
      "   0.00602801  0.00952387  0.00181817  0.00213157  0.00202488  0.00602801\n",
      "   0.00322667  0.00181817  0.00181817  0.0028726   0.00181817  0.00114098\n",
      "   0.00322667  0.00812362  0.00114098  0.00181817  0.00322667  0.00181817\n",
      "   0.00202488  0.00181817  0.00181817  0.00536653  0.00339667  0.00114098\n",
      "   0.00181817  0.00378284  0.00322667  0.00322667  0.00114098  0.00812362\n",
      "   0.00213157  0.00812362  0.00181817  0.0028726   0.00952387  0.00536653\n",
      "   0.00812362  0.00509794  0.00213157  0.00855163  0.0028726   0.00181817\n",
      "   0.0028726   0.0028726   0.00181817  0.00322667  0.00213157  0.00181817\n",
      "   0.00536653  0.00322667  0.00181817  0.00181817  0.00322667  0.00536653\n",
      "   0.00812362  0.00812362  0.00114098  0.00536653  0.00213157  0.00602801\n",
      "   0.00181817  0.00181817  0.00322667  0.00114098  0.0028726   0.0028726\n",
      "   0.00322667  0.00181817  0.00322667  0.00213157  0.00322667  0.00181817\n",
      "   0.00181817  0.00181817  0.0028726   0.00213157  0.00536653  0.00114098\n",
      "   0.00457752  0.00213157  0.00114098  0.00322667  0.00952387]]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "classEst:  [[ 1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.\n",
      "   1.  1.  1.  1.  1.  1.  1. -1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.\n",
      "  -1.  1.  1. -1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.\n",
      "   1.  1. -1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1. -1.  1. -1.  1.\n",
      "  -1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1. -1.  1.  1.\n",
      "  -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1. -1.  1.\n",
      "   1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1. -1.  1.\n",
      "   1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1. -1.  1. -1.  1.  1.  1.\n",
      "  -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1. -1.\n",
      "  -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1. -1. -1. -1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.]]\n",
      "aggClassEst:  [[-0.47092125  0.91834361  1.02602298  0.45240351 -0.56863831  1.02602298\n",
      "   1.02602298  0.45240351 -0.47092125 -0.47092125  0.45240351  0.45240351\n",
      "   1.02602298  0.45240351  0.91834361 -0.47092125 -1.09588615  0.62994605\n",
      "   0.45240351 -0.17256139 -0.47092125  1.02602298  1.02602298  0.91834361\n",
      "   0.91834361  0.05632659  0.45240351  1.02602298  0.62994605  1.49196307\n",
      "  -1.09588615  0.45240351  0.45240351  0.45240351 -0.47092125 -1.09588615\n",
      "   0.05632659 -0.62994605  1.02602298  0.05632659 -1.09588615  0.05632659\n",
      "   0.45240351 -0.00498115 -0.62994605 -1.09588615 -1.09588615  1.02602298\n",
      "  -0.17256139 -1.09588615  1.02602298  0.45240351  1.02602298  0.62994605\n",
      "  -0.17256139  0.45240351  0.62994605 -0.47092125 -0.52226668 -1.09588615\n",
      "   1.02602298  0.45240351 -0.56863831  0.2933787   0.45240351  0.91834361\n",
      "   0.2933787   1.02602298  0.00498115  1.02602298  0.05632659  1.02602298\n",
      "   0.05632659 -0.52226668  0.62994605  0.45240351  1.49196307  1.49196307\n",
      "   0.10269822 -0.17256139 -0.47092125  1.02602298  0.45240351 -0.91834361\n",
      "   0.45240351  1.02602298 -0.47092125  0.62994605  0.45240351  1.02602298\n",
      "   0.47092125 -0.17256139  1.02602298  0.10269822  1.02602298  1.49196307\n",
      "   0.45240351 -0.17256139  1.02602298 -0.17256139  1.49196307 -0.47092125\n",
      "   0.62994605  0.45240351  0.10269822  0.45240351  0.62994605  1.02602298\n",
      "  -0.62994605  0.45240351 -0.17256139  1.02602298  1.02602298  0.05632659\n",
      "   0.56863831  1.49196307  1.49196307  1.02602298 -0.00498115  0.91834361\n",
      "   1.02602298 -1.09588615  1.02602298 -0.47092125  1.02602298  1.02602298\n",
      "   0.10269822  0.10269822  0.45240351  0.62994605  0.62994605  0.45240351\n",
      "   1.02602298 -1.09588615 -0.47092125  0.10269822  1.02602298  0.91834361\n",
      "   0.45240351  1.02602298  0.00498115 -1.09588615  1.02602298  0.2933787\n",
      "   0.91834361  1.49196307  1.02602298 -0.17256139  1.49196307  1.49196307\n",
      "  -0.52226668  0.2933787   1.02602298  1.49196307  1.02602298  1.02602298\n",
      "   0.91834361  1.02602298  1.02602298 -0.2933787   0.62994605  0.45240351\n",
      "  -0.47092125  0.45240351  0.2933787   1.02602298  1.02602298 -0.17256139\n",
      "  -0.86699817  1.02602298 -0.17256139  0.2933787  -0.17256139 -0.2933787\n",
      "   0.62994605  0.91834361 -0.86699817 -0.00498115 -0.47092125 -0.47092125\n",
      "   0.62994605 -0.91834361  0.91834361  0.91834361 -0.17256139  0.45240351\n",
      "   0.45240351  0.45240351  0.45240351  1.02602298 -0.47092125  1.49196307\n",
      "  -1.09588615  0.45240351  1.49196307 -0.17256139 -0.17256139  0.91834361\n",
      "   0.45240351  1.02602298 -0.47092125  0.62994605  1.02602298  0.10269822\n",
      "  -0.47092125 -0.00498115  0.62994605  0.2933787   1.02602298  0.45240351\n",
      "   0.45240351  0.45240351  1.02602298  0.45240351  1.02602298  0.62994605\n",
      "  -0.56863831  1.02602298  1.02602298 -0.47092125  0.91834361 -0.17256139\n",
      "   0.45240351  1.02602298  1.02602298 -0.17256139  0.62994605 -1.09588615\n",
      "   0.45240351 -0.47092125 -1.09588615  0.62994605  0.45240351  1.02602298\n",
      "  -0.52226668  1.02602298  1.02602298  0.45240351 -0.00498115 -1.09588615\n",
      "   1.02602298  0.10269822  0.45240351  0.45240351 -1.09588615 -0.47092125\n",
      "  -0.47092125 -0.47092125  1.02602298 -0.17256139  1.02602298  0.45240351\n",
      "  -0.47092125 -0.00498115 -0.47092125  0.91834361 -0.17256139  1.02602298\n",
      "  -0.17256139  0.56863831  0.62994605  0.05632659 -0.47092125  1.02602298\n",
      "   0.45240351  0.45240351  1.02602298  1.02602298  0.45240351  0.45240351\n",
      "  -0.47092125 -0.47092125 -1.09588615  0.45240351 -0.47092125  0.56863831\n",
      "   1.02602298  1.02602298  0.45240351  1.49196307 -0.17256139 -0.17256139\n",
      "   0.05632659  1.02602298  0.45240351 -0.86699817  0.05632659  0.62994605\n",
      "   1.02602298  1.02602298 -0.17256139 -0.47092125  0.45240351  1.49196307\n",
      "   0.2933787  -0.47092125 -1.09588615  0.45240351  0.62994605]]\n",
      "total error:  0.254180602007\n",
      "D: [[ 0.00264952  0.0106296   0.00152086  0.00667055  0.00240286  0.00152086\n",
      "   0.00152086  0.00667055  0.00264952  0.00679523  0.00269904  0.00269904\n",
      "   0.00152086  0.00667055  0.00169377  0.00264952  0.00141823  0.00225997\n",
      "   0.00269904  0.00504229  0.00679523  0.00152086  0.00152086  0.00169377\n",
      "   0.00169377  0.00401073  0.00269904  0.00152086  0.0079665   0.00095441\n",
      "   0.00141823  0.00667055  0.00269904  0.00269904  0.00679523  0.00141823\n",
      "   0.00448898  0.0079665   0.00152086  0.00448898  0.00141823  0.00401073\n",
      "   0.00269904  0.00422204  0.00225997  0.00141823  0.01269471  0.00152086\n",
      "   0.00357061  0.00141823  0.00152086  0.00667055  0.00152086  0.00225997\n",
      "   0.00357061  0.00667055  0.00225997  0.00264952  0.00251691  0.00141823\n",
      "   0.00152086  0.00269904  0.00240286  0.00568982  0.00269904  0.00169377\n",
      "   0.00316426  0.00152086  0.00422204  0.00152086  0.00448898  0.00152086\n",
      "   0.00448898  0.00251691  0.0079665   0.00667055  0.00095441  0.00095441\n",
      "   0.00470204  0.00504229  0.00264952  0.00152086  0.00269904  0.00169377\n",
      "   0.00269904  0.00152086  0.00264952  0.0079665   0.00269904  0.00152086\n",
      "   0.00264952  0.00357061  0.00152086  0.00470204  0.00152086  0.00095441\n",
      "   0.00269904  0.00357061  0.00152086  0.00504229  0.00095441  0.00264952\n",
      "   0.00225997  0.00269904  0.00470204  0.00269904  0.00225997  0.00152086\n",
      "   0.00225997  0.00667055  0.00357061  0.00152086  0.00152086  0.00448898\n",
      "   0.00240286  0.00095441  0.00095441  0.01183809  0.00426431  0.00169377\n",
      "   0.00152086  0.00141823  0.00152086  0.00264952  0.01183809  0.00152086\n",
      "   0.00382899  0.00382899  0.00667055  0.00225997  0.0079665   0.00667055\n",
      "   0.00152086  0.00141823  0.00264952  0.00470204  0.00152086  0.00169377\n",
      "   0.00269904  0.00152086  0.00426431  0.00141823  0.00152086  0.00568982\n",
      "   0.00169377  0.00095441  0.01183809  0.00504229  0.00095441  0.00095441\n",
      "   0.00251691  0.00316426  0.00152086  0.00095441  0.00152086  0.00152086\n",
      "   0.0106296   0.00152086  0.00152086  0.00568982  0.0079665   0.00269904\n",
      "   0.00264952  0.00269904  0.00568982  0.00152086  0.00152086  0.00504229\n",
      "   0.00178301  0.00152086  0.00357061  0.00316426  0.00357061  0.00316426\n",
      "   0.00225997  0.00169377  0.00178301  0.00426431  0.00264952  0.00264952\n",
      "   0.00225997  0.00169377  0.00169377  0.00169377  0.00504229  0.00269904\n",
      "   0.00269904  0.00269904  0.00269904  0.00152086  0.00679523  0.00095441\n",
      "   0.00141823  0.00269904  0.00095441  0.00357061  0.00357061  0.00169377\n",
      "   0.00269904  0.00152086  0.00264952  0.0079665   0.00152086  0.00382899\n",
      "   0.00264952  0.00426431  0.0079665   0.00568982  0.00152086  0.00667055\n",
      "   0.00667055  0.00269904  0.00152086  0.00269904  0.00152086  0.00225997\n",
      "   0.00749276  0.01183809  0.00152086  0.00264952  0.00169377  0.00504229\n",
      "   0.00269904  0.00152086  0.00152086  0.00357061  0.00225997  0.00141823\n",
      "   0.00269904  0.00679523  0.00141823  0.00225997  0.00269904  0.00152086\n",
      "   0.00251691  0.00152086  0.00152086  0.00667055  0.00422204  0.00141823\n",
      "   0.00152086  0.00470204  0.00269904  0.00269904  0.00141823  0.00679523\n",
      "   0.00264952  0.00679523  0.00152086  0.00357061  0.01183809  0.00667055\n",
      "   0.00679523  0.00426431  0.00264952  0.0106296   0.00357061  0.00152086\n",
      "   0.00357061  0.00240286  0.00225997  0.00401073  0.00264952  0.00152086\n",
      "   0.00667055  0.00269904  0.00152086  0.00152086  0.00269904  0.00667055\n",
      "   0.00679523  0.00679523  0.00141823  0.00667055  0.00264952  0.00749276\n",
      "   0.00152086  0.00152086  0.00269904  0.00095441  0.00357061  0.00357061\n",
      "   0.00401073  0.00152086  0.00269904  0.00178301  0.00401073  0.00225997\n",
      "   0.00152086  0.00152086  0.00357061  0.00264952  0.00667055  0.00095441\n",
      "   0.00568982  0.00264952  0.00141823  0.00269904  0.0079665 ]]\n",
      "classEst:  [[-1.  1.  1. -1.  1.  1.  1. -1. -1.  1. -1.  1.  1.  1. -1. -1. -1.  1.\n",
      "   1. -1.  1.  1.  1.  1. -1.  1. -1. -1.  1.  1. -1. -1.  1.  1. -1. -1.\n",
      "   1.  1.  1.  1. -1.  1. -1. -1. -1. -1. -1.  1. -1. -1.  1.  1.  1.  1.\n",
      "  -1. -1.  1.  1. -1. -1.  1.  1.  1. -1. -1. -1.  1.  1.  1.  1. -1.  1.\n",
      "   1.  1.  1. -1. -1.  1. -1.  1. -1.  1. -1. -1.  1.  1. -1.  1.  1.  1.\n",
      "   1. -1. -1. -1. -1.  1.  1. -1.  1. -1. -1. -1. -1.  1.  1.  1.  1.  1.\n",
      "  -1. -1. -1. -1.  1.  1. -1. -1.  1. -1.  1.  1.  1.  1.  1.  1. -1. -1.\n",
      "  -1. -1.  1.  1.  1. -1.  1. -1. -1. -1.  1.  1.  1. -1.  1. -1.  1. -1.\n",
      "  -1.  1.  1.  1.  1. -1. -1. -1. -1.  1. -1.  1.  1. -1.  1.  1.  1. -1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1. -1. -1. -1. -1.  1.  1.  1. -1. -1. -1.\n",
      "   1. -1.  1.  1. -1.  1. -1.  1. -1.  1.  1.  1. -1.  1. -1.  1. -1.  1.\n",
      "  -1.  1.  1.  1.  1. -1. -1.  1.  1. -1. -1.  1. -1.  1. -1.  1.  1.  1.\n",
      "   1.  1. -1. -1. -1. -1.  1.  1.  1. -1.  1. -1.  1. -1. -1.  1. -1. -1.\n",
      "   1.  1.  1. -1.  1. -1.  1.  1.  1.  1. -1. -1. -1.  1.  1. -1. -1. -1.\n",
      "  -1. -1.  1.  1. -1.  1. -1.  1.  1.  1.  1. -1. -1.  1. -1.  1.  1. -1.\n",
      "  -1. -1. -1.  1.  1. -1.  1.  1. -1.  1. -1. -1.  1.  1.  1. -1.  1.  1.\n",
      "   1.  1. -1.  1. -1.  1. -1. -1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.65940012  1.10682248  1.21450185  0.26392464 -0.38015944  1.21450185\n",
      "   1.21450185  0.26392464 -0.65940012 -0.28244237  0.26392464  0.64088239\n",
      "   1.21450185  0.64088239  0.72986473 -0.65940012 -1.28436502  0.81842493\n",
      "   0.64088239 -0.36104026 -0.28244237  1.21450185  1.21450185  1.10682248\n",
      "   0.72986473  0.24480546  0.26392464  0.8375441   0.81842493  1.68044194\n",
      "  -1.28436502  0.26392464  0.64088239  0.64088239 -0.65940012 -1.28436502\n",
      "   0.24480546 -0.44146718  1.21450185  0.24480546 -1.28436502  0.24480546\n",
      "   0.26392464 -0.19346003 -0.81842493 -1.28436502 -1.28436502  1.21450185\n",
      "  -0.36104026 -1.28436502  1.21450185  0.64088239  1.21450185  0.81842493\n",
      "  -0.36104026  0.26392464  0.81842493 -0.28244237 -0.71074556 -1.28436502\n",
      "   1.21450185  0.64088239 -0.38015944  0.10489983  0.26392464  0.72986473\n",
      "   0.48185758  1.21450185  0.19346003  1.21450185 -0.13215228  1.21450185\n",
      "   0.24480546 -0.33378781  0.81842493  0.26392464  1.3034842   1.68044194\n",
      "  -0.08578066  0.01591749 -0.65940012  1.21450185  0.26392464 -1.10682248\n",
      "   0.64088239  1.21450185 -0.65940012  0.81842493  0.64088239  1.21450185\n",
      "   0.65940012 -0.36104026  0.8375441  -0.08578066  0.8375441   1.68044194\n",
      "   0.64088239 -0.36104026  1.21450185 -0.36104026  1.3034842  -0.65940012\n",
      "   0.44146718  0.64088239  0.29117709  0.64088239  0.81842493  1.21450185\n",
      "  -0.81842493  0.26392464 -0.36104026  0.8375441   1.21450185  0.24480546\n",
      "   0.38015944  1.3034842   1.68044194  0.8375441   0.18349772  1.10682248\n",
      "   1.21450185 -0.90740727  1.21450185 -0.28244237  0.8375441   0.8375441\n",
      "  -0.08578066 -0.08578066  0.64088239  0.81842493  0.81842493  0.26392464\n",
      "   1.21450185 -1.28436502 -0.65940012 -0.08578066  1.21450185  1.10682248\n",
      "   0.64088239  0.8375441   0.19346003 -1.28436502  1.21450185  0.10489983\n",
      "   0.72986473  1.68044194  1.21450185  0.01591749  1.68044194  1.3034842\n",
      "  -0.71074556  0.10489983  0.8375441   1.68044194  0.8375441   1.21450185\n",
      "   1.10682248  0.8375441   1.21450185 -0.10489983  0.81842493  0.26392464\n",
      "  -0.28244237  0.64088239  0.48185758  1.21450185  1.21450185  0.01591749\n",
      "  -0.6785193   1.21450185 -0.36104026  0.10489983 -0.36104026 -0.48185758\n",
      "   0.81842493  1.10682248 -0.6785193  -0.19346003 -0.65940012 -0.65940012\n",
      "   0.81842493 -1.10682248  1.10682248  1.10682248 -0.36104026  0.64088239\n",
      "   0.26392464  0.64088239  0.26392464  1.21450185 -0.28244237  1.68044194\n",
      "  -1.28436502  0.64088239  1.3034842   0.01591749 -0.36104026  1.10682248\n",
      "   0.26392464  1.21450185 -0.28244237  0.81842493  1.21450185 -0.08578066\n",
      "  -0.65940012  0.18349772  0.81842493  0.10489983  0.8375441   0.64088239\n",
      "   0.26392464  0.64088239  0.8375441   0.64088239  1.21450185  0.81842493\n",
      "  -0.38015944  1.21450185  0.8375441  -0.65940012  0.72986473 -0.36104026\n",
      "   0.64088239  1.21450185  1.21450185 -0.36104026  0.81842493 -1.28436502\n",
      "   0.64088239 -0.65940012 -1.28436502  0.81842493  0.26392464  0.8375441\n",
      "  -0.33378781  1.21450185  1.21450185  0.26392464  0.18349772 -1.28436502\n",
      "   1.21450185  0.29117709  0.64088239  0.64088239 -1.28436502 -0.65940012\n",
      "  -0.65940012 -0.28244237  1.21450185 -0.36104026  0.8375441   0.26392464\n",
      "  -0.65940012 -0.19346003 -0.28244237  1.10682248 -0.36104026  1.21450185\n",
      "  -0.36104026  0.75711718  0.81842493  0.24480546 -0.28244237  0.8375441\n",
      "   0.26392464  0.64088239  0.8375441   1.21450185  0.64088239  0.26392464\n",
      "  -0.65940012 -0.65940012 -1.28436502  0.64088239 -0.28244237  0.38015944\n",
      "   1.21450185  1.21450185  0.26392464  1.68044194 -0.36104026 -0.36104026\n",
      "   0.24480546  1.21450185  0.64088239 -1.05547704  0.24480546  0.81842493\n",
      "   1.21450185  1.21450185 -0.36104026 -0.28244237  0.26392464  1.68044194\n",
      "   0.10489983 -0.65940012 -1.28436502  0.26392464  0.81842493]]\n",
      "total error:  0.240802675585\n",
      "D: [[ 0.00223347  0.01306294  0.00128204  0.00562309  0.00295293  0.00128204\n",
      "   0.00128204  0.00562309  0.00223347  0.00572819  0.00331691  0.00227522\n",
      "   0.00128204  0.00819758  0.00208151  0.00223347  0.00119553  0.0019051\n",
      "   0.00227522  0.00619658  0.00572819  0.00128204  0.00128204  0.0014278\n",
      "   0.00208151  0.00338093  0.00331691  0.00186902  0.0097902   0.00080454\n",
      "   0.00119553  0.00562309  0.00227522  0.00227522  0.0083508   0.00119553\n",
      "   0.0055166   0.00671554  0.00128204  0.0055166   0.00119553  0.00338093\n",
      "   0.00331691  0.00355906  0.0019051   0.00119553  0.0156008   0.00128204\n",
      "   0.00300993  0.00119553  0.00128204  0.00819758  0.00128204  0.0019051\n",
      "   0.00300993  0.00562309  0.0019051   0.00325605  0.00212169  0.00119553\n",
      "   0.00128204  0.00227522  0.00295293  0.00479636  0.00331691  0.00208151\n",
      "   0.00266739  0.00128204  0.00355906  0.00128204  0.00378409  0.00128204\n",
      "   0.0055166   0.00309309  0.0097902   0.00562309  0.00117289  0.00080454\n",
      "   0.00396369  0.00425051  0.00223347  0.00128204  0.00331691  0.0014278\n",
      "   0.00227522  0.00128204  0.00223347  0.0097902   0.00227522  0.00128204\n",
      "   0.00223347  0.00300993  0.00186902  0.00396369  0.00186902  0.00080454\n",
      "   0.00227522  0.00300993  0.00128204  0.00619658  0.00117289  0.00223347\n",
      "   0.00277733  0.00227522  0.00577844  0.00227522  0.0019051   0.00128204\n",
      "   0.0019051   0.00562309  0.00300993  0.00186902  0.00128204  0.0055166\n",
      "   0.00295293  0.00117289  0.00080454  0.00997918  0.0035947   0.0014278\n",
      "   0.00128204  0.0017429   0.00128204  0.00325605  0.00997918  0.00186902\n",
      "   0.00470553  0.00470553  0.00819758  0.0019051   0.0097902   0.00562309\n",
      "   0.00128204  0.00119553  0.00223347  0.00396369  0.00128204  0.0014278\n",
      "   0.00227522  0.00186902  0.0052405   0.00119553  0.00128204  0.00479636\n",
      "   0.00208151  0.00080454  0.01454808  0.00425051  0.00080454  0.00117289\n",
      "   0.00212169  0.00388863  0.00186902  0.00080454  0.00186902  0.00128204\n",
      "   0.01306294  0.00186902  0.00128204  0.00479636  0.0097902   0.00331691\n",
      "   0.00325605  0.00227522  0.00699234  0.00128204  0.00128204  0.00425051\n",
      "   0.00219117  0.00128204  0.00300993  0.00388863  0.00300993  0.00266739\n",
      "   0.0019051   0.0014278   0.00219117  0.0052405   0.00223347  0.00223347\n",
      "   0.0019051   0.0014278   0.0014278   0.0014278   0.00619658  0.00227522\n",
      "   0.00331691  0.00227522  0.00331691  0.00128204  0.00572819  0.00080454\n",
      "   0.00119553  0.00227522  0.00117289  0.004388    0.00300993  0.0014278\n",
      "   0.00331691  0.00128204  0.00325605  0.0097902   0.00128204  0.00470553\n",
      "   0.00223347  0.0035947   0.0097902   0.00479636  0.00186902  0.00819758\n",
      "   0.00562309  0.00227522  0.00186902  0.00227522  0.00128204  0.0019051\n",
      "   0.00631619  0.01454808  0.00186902  0.00223347  0.00208151  0.00619658\n",
      "   0.00227522  0.00128204  0.00128204  0.00300993  0.0019051   0.00119553\n",
      "   0.00227522  0.0083508   0.00119553  0.0019051   0.00331691  0.00186902\n",
      "   0.00309309  0.00128204  0.00128204  0.00562309  0.00518855  0.00119553\n",
      "   0.00128204  0.00577844  0.00227522  0.00227522  0.00119553  0.0083508\n",
      "   0.00223347  0.00572819  0.00128204  0.00300993  0.00997918  0.00562309\n",
      "   0.0083508   0.0052405   0.00325605  0.01306294  0.00300993  0.00128204\n",
      "   0.00300993  0.00202555  0.0019051   0.00338093  0.00325605  0.00186902\n",
      "   0.00562309  0.00227522  0.00186902  0.00128204  0.00227522  0.00562309\n",
      "   0.0083508   0.0083508   0.00119553  0.00819758  0.00325605  0.00631619\n",
      "   0.00128204  0.00128204  0.00331691  0.00080454  0.00300993  0.00300993\n",
      "   0.00338093  0.00128204  0.00227522  0.00150303  0.00338093  0.0019051\n",
      "   0.00128204  0.00128204  0.00300993  0.00325605  0.00562309  0.00080454\n",
      "   0.00479636  0.00223347  0.00119553  0.00331691  0.0097902 ]]\n",
      "classEst:  [[-1. -1. -1. -1. -1.  1. -1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1. -1.\n",
      "  -1. -1.  1.  1. -1. -1.  1. -1.  1. -1. -1. -1.  1. -1.  1. -1.  1. -1.\n",
      "  -1. -1. -1. -1. -1. -1. -1. -1.  1. -1.  1. -1.  1. -1. -1. -1. -1. -1.\n",
      "   1.  1. -1.  1.  1. -1. -1.  1.  1. -1. -1. -1. -1.  1.  1. -1.  1.  1.\n",
      "  -1.  1. -1. -1. -1. -1.  1.  1. -1.  1. -1. -1. -1.  1.  1. -1.  1. -1.\n",
      "  -1.  1.  1. -1. -1.  1.  1. -1. -1. -1. -1. -1. -1. -1.  1.  1. -1. -1.\n",
      "  -1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1. -1. -1. -1. -1.  1.  1.  1.\n",
      "  -1.  1. -1.  1. -1. -1. -1.  1.  1.  1.  1. -1. -1. -1. -1. -1.  1.  1.\n",
      "   1. -1. -1.  1. -1. -1. -1.  1.  1.  1.  1. -1.  1. -1.  1. -1. -1.  1.\n",
      "  -1.  1. -1. -1.  1.  1.  1. -1. -1. -1. -1. -1. -1.  1. -1. -1.  1.  1.\n",
      "  -1. -1.  1.  1. -1. -1.  1. -1.  1. -1. -1. -1. -1. -1. -1.  1. -1. -1.\n",
      "  -1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1. -1. -1.  1.  1.  1.  1. -1.\n",
      "  -1. -1.  1. -1. -1.  1.  1. -1.  1. -1. -1.  1.  1. -1. -1. -1.  1. -1.\n",
      "   1. -1. -1.  1. -1. -1. -1.  1. -1. -1. -1.  1.  1.  1.  1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1.  1.  1. -1.  1. -1.  1.  1.  1. -1. -1. -1. -1.  1.\n",
      "   1.  1. -1. -1. -1.  1.  1. -1.  1. -1. -1.  1. -1.  1.  1. -1. -1. -1.\n",
      "  -1. -1.  1. -1.  1. -1. -1.  1.  1.  1. -1.]]\n",
      "aggClassEst:  [[-0.81167381  0.95454879  1.06222816  0.11165095 -0.53243313  1.36677554\n",
      "   1.06222816  0.41619833 -0.50712643 -0.13016868  0.41619833  0.4886087\n",
      "   1.36677554  0.79315608  0.88213842 -0.50712643 -1.13209133  0.66615124\n",
      "   0.4886087  -0.51331395 -0.13016868  1.36677554  1.06222816  0.95454879\n",
      "   0.88213842  0.09253177  0.41619833  0.68527041  0.66615124  1.52816825\n",
      "  -1.13209133  0.11165095  0.79315608  0.4886087  -0.50712643 -1.43663871\n",
      "   0.09253177 -0.59374087  1.06222816  0.09253177 -1.43663871  0.09253177\n",
      "   0.11165095 -0.34573372 -0.66615124 -1.43663871 -1.13209133  1.06222816\n",
      "  -0.20876657 -1.43663871  1.06222816  0.4886087   1.06222816  0.66615124\n",
      "  -0.20876657  0.41619833  0.66615124 -0.13016868 -0.55847187 -1.43663871\n",
      "   1.06222816  0.79315608 -0.22788575 -0.04737386  0.11165095  0.57759104\n",
      "   0.32958389  1.36677554  0.34573372  1.06222816  0.02012141  1.36677554\n",
      "   0.09253177 -0.18151412  0.66615124  0.11165095  1.15121051  1.52816825\n",
      "   0.06649303  0.16819118 -0.81167381  1.36677554  0.11165095 -1.25909617\n",
      "   0.4886087   1.36677554 -0.50712643  0.66615124  0.79315608  1.06222816\n",
      "   0.50712643 -0.20876657  0.98981779 -0.23805435  0.68527041  1.83271563\n",
      "   0.79315608 -0.51331395  1.06222816 -0.51331395  1.15121051 -0.81167381\n",
      "   0.28919349  0.4886087   0.44345078  0.79315608  0.66615124  1.06222816\n",
      "  -0.97069862  0.11165095 -0.20876657  0.68527041  1.06222816  0.09253177\n",
      "   0.53243313  1.15121051  1.83271563  0.68527041  0.03122403  0.95454879\n",
      "   1.06222816 -1.05968096  1.06222816 -0.13016868  0.98981779  0.98981779\n",
      "  -0.23805435  0.06649303  0.4886087   0.97069862  0.66615124  0.11165095\n",
      "   1.06222816 -1.13209133 -0.50712643  0.06649303  1.36677554  0.95454879\n",
      "   0.4886087   0.68527041  0.04118634 -1.43663871  1.36677554  0.25717352\n",
      "   0.88213842  1.52816825  1.06222816  0.16819118  1.52816825  1.15121051\n",
      "  -0.86301925  0.25717352  0.98981779  1.83271563  0.98981779  1.06222816\n",
      "   1.25909617  0.68527041  1.36677554 -0.25717352  0.66615124  0.41619833\n",
      "  -0.43471606  0.79315608  0.32958389  1.06222816  1.36677554  0.16819118\n",
      "  -0.52624561  1.06222816 -0.51331395 -0.04737386 -0.51331395 -0.63413127\n",
      "   0.66615124  1.25909617 -0.83079299 -0.34573372 -0.50712643 -0.50712643\n",
      "   0.66615124 -1.25909617  1.25909617  1.25909617 -0.51331395  0.4886087\n",
      "   0.41619833  0.4886087   0.41619833  1.06222816 -0.43471606  1.52816825\n",
      "  -1.43663871  0.4886087   1.15121051  0.16819118 -0.51331395  0.95454879\n",
      "   0.11165095  1.36677554 -0.13016868  0.66615124  1.36677554  0.06649303\n",
      "  -0.50712643  0.33577141  0.66615124  0.25717352  0.98981779  0.4886087\n",
      "   0.11165095  0.79315608  0.98981779  0.79315608  1.36677554  0.66615124\n",
      "  -0.53243313  1.06222816  0.98981779 -0.81167381  0.57759104 -0.20876657\n",
      "   0.79315608  1.06222816  1.36677554 -0.51331395  0.66615124 -1.13209133\n",
      "   0.79315608 -0.81167381 -1.43663871  0.66615124  0.41619833  0.68527041\n",
      "  -0.18151412  1.06222816  1.06222816  0.41619833  0.03122403 -1.43663871\n",
      "   1.06222816  0.44345078  0.4886087   0.4886087  -1.43663871 -0.50712643\n",
      "  -0.50712643 -0.13016868  1.36677554 -0.51331395  0.68527041  0.11165095\n",
      "  -0.81167381 -0.34573372 -0.43471606  0.95454879 -0.51331395  1.36677554\n",
      "  -0.20876657  0.60484349  0.97069862  0.09253177 -0.13016868  0.98981779\n",
      "   0.41619833  0.4886087   0.68527041  1.06222816  0.4886087   0.41619833\n",
      "  -0.50712643 -0.50712643 -1.43663871  0.4886087  -0.43471606  0.53243313\n",
      "   1.36677554  1.06222816  0.41619833  1.52816825 -0.51331395 -0.20876657\n",
      "   0.09253177  1.36677554  0.79315608 -1.20775073  0.09253177  0.66615124\n",
      "   1.06222816  1.06222816 -0.20876657 -0.43471606  0.41619833  1.52816825\n",
      "  -0.04737386 -0.50712643 -1.13209133  0.41619833  0.66615124]]\n",
      "total error:  0.240802675585\n",
      "D: [[ 0.00194028  0.01134815  0.00151025  0.00488494  0.00256529  0.00111375\n",
      "   0.00151025  0.00662403  0.00263104  0.00497624  0.00288149  0.00268022\n",
      "   0.00111375  0.0096568   0.00180826  0.00263104  0.00140834  0.00224421\n",
      "   0.00268022  0.0072996   0.00497624  0.00111375  0.00151025  0.00168196\n",
      "   0.00180826  0.00398276  0.00288149  0.00220171  0.00850503  0.00094775\n",
      "   0.00140834  0.00488494  0.00197654  0.00268022  0.00725458  0.00103859\n",
      "   0.00479243  0.00791094  0.00151025  0.00479243  0.00103859  0.00398276\n",
      "   0.00390733  0.00309186  0.00224421  0.00103859  0.01355286  0.00151025\n",
      "   0.00354571  0.00103859  0.00151025  0.00712147  0.00151025  0.00224421\n",
      "   0.00354571  0.00662403  0.00224421  0.00383564  0.00249936  0.00103859\n",
      "   0.00151025  0.00197654  0.00347857  0.00416673  0.00390733  0.00245203\n",
      "   0.0031422   0.00111375  0.00309186  0.00151025  0.00445768  0.00111375\n",
      "   0.00479243  0.00364367  0.00850503  0.00488494  0.00138167  0.00094775\n",
      "   0.00466925  0.00369254  0.00194028  0.00111375  0.00390733  0.00124037\n",
      "   0.00268022  0.00111375  0.00263104  0.00850503  0.00197654  0.00151025\n",
      "   0.00263104  0.00354571  0.00162367  0.00344337  0.00220171  0.00069893\n",
      "   0.00197654  0.00261481  0.00151025  0.0072996   0.00138167  0.00194028\n",
      "   0.00327171  0.00268022  0.00680704  0.00197654  0.00224421  0.00151025\n",
      "   0.00165501  0.00488494  0.00354571  0.00220171  0.00151025  0.00479243\n",
      "   0.00256529  0.00138167  0.00069893  0.0086692   0.00423457  0.00168196\n",
      "   0.00151025  0.00151411  0.00151025  0.00383564  0.01175553  0.00162367\n",
      "   0.00554314  0.00408783  0.00712147  0.00165501  0.00850503  0.00488494\n",
      "   0.00151025  0.00140834  0.00263104  0.00466925  0.00111375  0.00168196\n",
      "   0.00268022  0.00220171  0.00455257  0.00103859  0.00111375  0.00565014\n",
      "   0.00180826  0.00094775  0.01263833  0.00369254  0.00094775  0.00138167\n",
      "   0.00184317  0.00337816  0.00162367  0.00069893  0.00162367  0.00151025\n",
      "   0.01538822  0.00220171  0.00111375  0.00565014  0.00850503  0.00288149\n",
      "   0.00282862  0.00197654  0.00607444  0.00151025  0.00111375  0.00369254\n",
      "   0.00258122  0.00151025  0.00261481  0.00458083  0.00261481  0.00231724\n",
      "   0.00224421  0.00124037  0.00190354  0.00617334  0.00263104  0.00263104\n",
      "   0.00224421  0.00124037  0.00124037  0.00124037  0.0072996   0.00268022\n",
      "   0.00288149  0.00268022  0.00288149  0.00151025  0.00674784  0.00094775\n",
      "   0.00103859  0.00268022  0.00138167  0.00516909  0.00261481  0.00168196\n",
      "   0.00390733  0.00111375  0.00383564  0.00850503  0.00111375  0.00408783\n",
      "   0.00263104  0.00312281  0.00850503  0.00565014  0.00162367  0.00712147\n",
      "   0.00488494  0.00197654  0.00162367  0.00197654  0.00111375  0.00224421\n",
      "   0.00744051  0.01263833  0.00162367  0.00194028  0.00245203  0.00538314\n",
      "   0.00197654  0.00151025  0.00111375  0.00261481  0.00224421  0.00140834\n",
      "   0.00197654  0.00983729  0.00103859  0.00224421  0.00288149  0.00220171\n",
      "   0.00364367  0.00151025  0.00151025  0.00662403  0.00450744  0.00103859\n",
      "   0.00151025  0.00680704  0.00268022  0.00268022  0.00103859  0.00725458\n",
      "   0.00263104  0.00497624  0.00111375  0.00261481  0.0086692   0.00488494\n",
      "   0.00983729  0.00617334  0.00282862  0.01134815  0.00261481  0.00111375\n",
      "   0.00354571  0.00238611  0.00165501  0.00398276  0.00383564  0.00162367\n",
      "   0.00662403  0.00268022  0.00220171  0.00151025  0.00268022  0.00662403\n",
      "   0.00725458  0.00725458  0.00103859  0.00712147  0.00282862  0.00744051\n",
      "   0.00111375  0.00151025  0.00288149  0.00094775  0.00261481  0.00354571\n",
      "   0.00398276  0.00111375  0.00197654  0.00130572  0.00398276  0.00224421\n",
      "   0.00151025  0.00151025  0.00354571  0.00282862  0.00662403  0.00094775\n",
      "   0.00416673  0.00263104  0.00140834  0.00288149  0.00850503]]\n",
      "classEst:  [[ 1. -1. -1. -1. -1. -1.  1.  1. -1.  1. -1. -1.  1. -1.  1. -1. -1.  1.\n",
      "  -1. -1. -1.  1. -1.  1. -1.  1. -1.  1.  1.  1. -1. -1.  1.  1. -1. -1.\n",
      "  -1.  1.  1.  1. -1.  1. -1. -1. -1. -1. -1.  1. -1. -1. -1. -1. -1.  1.\n",
      "   1. -1.  1. -1. -1. -1. -1.  1. -1. -1. -1. -1. -1.  1. -1.  1.  1.  1.\n",
      "   1. -1.  1. -1.  1.  1. -1. -1. -1.  1. -1. -1. -1. -1. -1.  1. -1.  1.\n",
      "   1.  1.  1.  1. -1. -1. -1. -1. -1. -1.  1. -1.  1.  1. -1. -1. -1. -1.\n",
      "  -1. -1. -1.  1.  1.  1. -1.  1.  1. -1.  1. -1. -1. -1.  1. -1. -1.  1.\n",
      "  -1.  1. -1.  1.  1.  1.  1. -1. -1. -1.  1. -1.  1.  1. -1. -1.  1. -1.\n",
      "  -1. -1. -1. -1.  1.  1. -1. -1.  1. -1. -1.  1. -1.  1. -1.  1.  1.  1.\n",
      "  -1. -1. -1.  1.  1. -1.  1. -1. -1. -1. -1. -1.  1. -1. -1. -1. -1. -1.\n",
      "   1. -1. -1. -1. -1.  1.  1.  1.  1. -1.  1.  1. -1. -1.  1. -1.  1.  1.\n",
      "  -1. -1. -1.  1.  1. -1. -1. -1.  1. -1.  1. -1. -1. -1. -1.  1.  1.  1.\n",
      "   1. -1. -1.  1.  1. -1. -1.  1.  1. -1.  1. -1.  1.  1. -1.  1. -1. -1.\n",
      "  -1.  1. -1. -1.  1. -1. -1. -1.  1. -1. -1. -1. -1. -1.  1. -1. -1. -1.\n",
      "  -1. -1.  1.  1. -1.  1.  1.  1.  1.  1. -1. -1.  1. -1. -1.  1.  1.  1.\n",
      "  -1. -1. -1.  1. -1.  1. -1.  1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.\n",
      "   1. -1. -1. -1. -1.  1. -1. -1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.6565651   0.79944008  0.90711945 -0.04345776 -0.68754184  1.21166683\n",
      "   1.21733687  0.57130704 -0.66223514  0.02494003  0.26108962  0.33349999\n",
      "   1.52188425  0.63804737  1.03724713 -0.66223514 -1.28720004  0.82125995\n",
      "   0.33349999 -0.66842266 -0.28527739  1.52188425  0.90711945  1.1096575\n",
      "   0.72702971  0.24764048  0.26108962  0.84037912  0.82125995  1.68327696\n",
      "  -1.28720004 -0.04345776  0.94826478  0.6437174  -0.66223514 -1.59174742\n",
      "  -0.06257693 -0.43863216  1.21733687  0.24764048 -1.59174742  0.24764048\n",
      "  -0.04345776 -0.50084242 -0.82125995 -1.59174742 -1.28720004  1.21733687\n",
      "  -0.36387528 -1.59174742  0.90711945  0.33349999  0.90711945  0.82125995\n",
      "  -0.05365786  0.26108962  0.82125995 -0.28527739 -0.71358057 -1.59174742\n",
      "   0.90711945  0.94826478 -0.38299446 -0.20248257 -0.04345776  0.42248233\n",
      "   0.17447518  1.52188425  0.19062501  1.21733687  0.17523011  1.52188425\n",
      "   0.24764048 -0.33662283  0.82125995 -0.04345776  1.30631921  1.68327696\n",
      "  -0.08861567  0.01308247 -0.96678252  1.52188425 -0.04345776 -1.41420488\n",
      "   0.33349999  1.21166683 -0.66223514  0.82125995  0.63804737  1.21733687\n",
      "   0.66223514 -0.05365786  1.1449265  -0.08294564  0.53016171  1.67760692\n",
      "   0.63804737 -0.66842266  0.90711945 -0.66842266  1.30631921 -0.96678252\n",
      "   0.4443022   0.6437174   0.28834207  0.63804737  0.51104253  0.90711945\n",
      "  -1.12580733 -0.04345776 -0.36387528  0.84037912  1.21733687  0.24764048\n",
      "   0.37732442  1.30631921  1.98782434  0.53016171  0.18633274  0.79944008\n",
      "   0.90711945 -1.21478967  1.21733687 -0.28527739  0.83470909  1.1449265\n",
      "  -0.39316305  0.22160174  0.33349999  1.12580733  0.82125995  0.26675966\n",
      "   1.21733687 -1.28720004 -0.66223514 -0.08861567  1.52188425  0.79944008\n",
      "   0.6437174   0.84037912 -0.11392237 -1.59174742  1.52188425  0.10206481\n",
      "   0.72702971  1.37305954  0.90711945  0.01308247  1.68327696  1.30631921\n",
      "  -1.01812795  0.10206481  1.1449265   1.67760692  0.83470909  1.21733687\n",
      "   1.10398746  0.84037912  1.21166683 -0.10206481  0.82125995  0.57130704\n",
      "  -0.58982477  0.63804737  0.17447518  1.21733687  1.52188425  0.01308247\n",
      "  -0.3711369   0.90711945 -0.66842266 -0.20248257 -0.66842266 -0.78923998\n",
      "   0.82125995  1.10398746 -0.98590169 -0.50084242 -0.66223514 -0.66223514\n",
      "   0.82125995 -1.41420488  1.10398746  1.10398746 -0.66842266  0.6437174\n",
      "   0.57130704  0.6437174   0.57130704  0.90711945 -0.27960735  1.68327696\n",
      "  -1.59174742  0.33349999  1.30631921  0.01308247 -0.35820524  1.1096575\n",
      "  -0.04345776  1.21166683 -0.28527739  0.82125995  1.52188425 -0.08861567\n",
      "  -0.66223514  0.1806627   0.82125995  0.10206481  1.1449265   0.33349999\n",
      "  -0.04345776  0.63804737  0.83470909  0.94826478  1.52188425  0.82125995\n",
      "  -0.37732442  0.90711945  0.83470909 -0.6565651   0.73269975 -0.36387528\n",
      "   0.63804737  1.21733687  1.52188425 -0.66842266  0.82125995 -1.28720004\n",
      "   0.94826478 -0.6565651  -1.59174742  0.82125995  0.26108962  0.53016171\n",
      "  -0.33662283  1.21733687  0.90711945  0.26108962  0.18633274 -1.59174742\n",
      "   0.90711945  0.28834207  0.6437174   0.33349999 -1.59174742 -0.66223514\n",
      "  -0.66223514 -0.28527739  1.52188425 -0.66842266  0.53016171 -0.04345776\n",
      "  -0.96678252 -0.50084242 -0.27960735  1.1096575  -0.66842266  1.52188425\n",
      "  -0.05365786  0.7599522   1.12580733  0.24764048 -0.28527739  0.83470909\n",
      "   0.57130704  0.33349999  0.53016171  1.21733687  0.6437174   0.57130704\n",
      "  -0.66223514 -0.66223514 -1.59174742  0.6437174  -0.58982477  0.68754184\n",
      "   1.21166683  1.21733687  0.57130704  1.68327696 -0.66842266 -0.36387528\n",
      "   0.24764048  1.52188425  0.94826478 -1.05264202  0.24764048  0.82125995\n",
      "   1.21733687  0.90711945 -0.36387528 -0.58982477  0.26108962  1.68327696\n",
      "  -0.20248257 -0.66223514 -1.28720004  0.26108962  0.82125995]]\n",
      "total error:  0.220735785953\n",
      "D: [[ 0.00229314  0.0098348   0.00178491  0.0042335   0.0022232   0.00131629\n",
      "   0.00130885  0.00782869  0.00228018  0.00431263  0.00340552  0.00316764\n",
      "   0.00096522  0.008369    0.00156712  0.00228018  0.00122053  0.00194493\n",
      "   0.00316764  0.00862712  0.00588122  0.00096522  0.00178491  0.00145766\n",
      "   0.00213712  0.00345163  0.00340552  0.0019081   0.01005176  0.00082136\n",
      "   0.00122053  0.0042335   0.00171296  0.00232279  0.0085739   0.00090009\n",
      "   0.00415333  0.00685597  0.00130885  0.00566399  0.00090009  0.00345163\n",
      "   0.00461792  0.00267954  0.00194493  0.00090009  0.01601759  0.00130885\n",
      "   0.00307287  0.00090009  0.00178491  0.00617178  0.00178491  0.00194493\n",
      "   0.00419054  0.00574068  0.00194493  0.00332414  0.00216605  0.00090009\n",
      "   0.00178491  0.00171296  0.00301468  0.00361107  0.00461792  0.00289795\n",
      "   0.00371364  0.00096522  0.00365415  0.00130885  0.00526835  0.00096522\n",
      "   0.00566399  0.00315777  0.01005176  0.0042335   0.00119742  0.00082136\n",
      "   0.00404658  0.00436407  0.00168153  0.00096522  0.00461792  0.00107496\n",
      "   0.00316764  0.00131629  0.00228018  0.01005176  0.002336    0.00130885\n",
      "   0.00228018  0.00419054  0.00140714  0.00406959  0.00260212  0.00082603\n",
      "   0.002336    0.00226611  0.00178491  0.00862712  0.00119742  0.00168153\n",
      "   0.00283541  0.00232279  0.00589928  0.002336    0.00265235  0.00178491\n",
      "   0.0014343   0.0042335   0.00307287  0.0019081   0.00130885  0.00566399\n",
      "   0.00303182  0.00119742  0.00060572  0.00751311  0.00366986  0.00198784\n",
      "   0.00178491  0.00131219  0.00130885  0.00332414  0.01018786  0.00140714\n",
      "   0.00655122  0.00354269  0.00617178  0.0014343   0.01005176  0.00577332\n",
      "   0.00130885  0.00122053  0.00228018  0.00404658  0.00096522  0.00198784\n",
      "   0.00232279  0.0019081   0.00394546  0.00090009  0.00096522  0.00489666\n",
      "   0.00213712  0.00112011  0.01095293  0.00436407  0.00082136  0.00119742\n",
      "   0.00159737  0.00399252  0.00140714  0.00082603  0.00191895  0.00130885\n",
      "   0.0133361   0.0019081   0.00131629  0.00489666  0.01005176  0.00249723\n",
      "   0.00245141  0.002336    0.00526438  0.00130885  0.00096522  0.00436407\n",
      "   0.00305064  0.00178491  0.00226611  0.0054139   0.00226611  0.00200822\n",
      "   0.00194493  0.00146594  0.00164969  0.00729603  0.00228018  0.00228018\n",
      "   0.00194493  0.00107496  0.00146594  0.00146594  0.00862712  0.00232279\n",
      "   0.00249723  0.00232279  0.00249723  0.00178491  0.00584797  0.00082136\n",
      "   0.00090009  0.00316764  0.00119742  0.00447976  0.00309034  0.00145766\n",
      "   0.00461792  0.00131629  0.00332414  0.01005176  0.00096522  0.00483124\n",
      "   0.00228018  0.00369073  0.01005176  0.00489666  0.00140714  0.00617178\n",
      "   0.0042335   0.002336    0.00191895  0.00171296  0.00096522  0.00194493\n",
      "   0.00644827  0.01095293  0.00191895  0.00229314  0.00212503  0.00636213\n",
      "   0.002336    0.00130885  0.00096522  0.00226611  0.00194493  0.00122053\n",
      "   0.00171296  0.00852542  0.00090009  0.00194493  0.00340552  0.00260212\n",
      "   0.00315777  0.00130885  0.00178491  0.00574068  0.00532717  0.00090009\n",
      "   0.00178491  0.00589928  0.00232279  0.00316764  0.00090009  0.0085739\n",
      "   0.00228018  0.00588122  0.00096522  0.00226611  0.00751311  0.0042335\n",
      "   0.0116263   0.00729603  0.00334304  0.01341194  0.00226611  0.00096522\n",
      "   0.00419054  0.0020679   0.0014343   0.00345163  0.00332414  0.00191895\n",
      "   0.00782869  0.00316764  0.00260212  0.00130885  0.00232279  0.00782869\n",
      "   0.0085739   0.0085739   0.00090009  0.00841659  0.00245141  0.00879365\n",
      "   0.00131629  0.00130885  0.00249723  0.00082136  0.00226611  0.00307287\n",
      "   0.00345163  0.00096522  0.00171296  0.00154318  0.00345163  0.00194493\n",
      "   0.00130885  0.00178491  0.00307287  0.00245141  0.00574068  0.00082136\n",
      "   0.00361107  0.00228018  0.00122053  0.00340552  0.01005176]]\n",
      "classEst:  [[ 1. -1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.\n",
      "   1.  1.  1.  1.  1. -1.  1. -1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.\n",
      "  -1. -1.  1. -1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.\n",
      "   1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "  -1.  1. -1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1. -1.  1.  1.\n",
      "  -1.  1.  1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.\n",
      "   1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.\n",
      "   1.  1. -1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.\n",
      "   1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1. -1.  1.\n",
      "   1.  1. -1.  1.  1.  1. -1.  1.  1.  1.  1.  1. -1.  1. -1.  1.  1.  1.\n",
      "  -1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1. -1.  1.  1.  1.  1.  1. -1.\n",
      "  -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1. -1.  1.  1. -1.  1.  1.\n",
      "   1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1. -1.  1. -1. -1.  1.  1.  1.  1. -1.  1.  1.\n",
      "   1.  1.  1. -1.  1.  1.  1.  1.  1. -1.  1.  1. -1.  1.  1.  1. -1. -1.\n",
      "  -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.]]\n",
      "aggClassEst:  [[-0.52120313  0.66407811  1.04248143  0.09190421 -0.82290381  1.34702881\n",
      "   1.35269884  0.70666901 -0.52687316  0.160302    0.39645159  0.46886196\n",
      "   1.65724622  0.77340934  1.1726091  -0.52687316 -1.15183806  0.68589797\n",
      "   0.46886196 -0.53306069 -0.14991542  1.65724622  1.04248143  0.97429552\n",
      "   0.86239169  0.11227851  0.39645159  0.9757411   0.68589797  1.81863893\n",
      "  -1.15183806  0.09190421  1.08362676  0.77907938 -0.52687316 -1.45638544\n",
      "  -0.19793891 -0.57399414  1.35269884  0.11227851 -1.45638544  0.11227851\n",
      "   0.09190421 -0.36548045 -0.68589797 -1.45638544 -1.15183806  1.35269884\n",
      "  -0.22851331 -1.45638544  1.04248143  0.46886196  1.04248143  0.68589797\n",
      "   0.08170411  0.39645159  0.68589797 -0.14991542 -0.5782186  -1.45638544\n",
      "   1.04248143  1.08362676 -0.24763248 -0.06712059  0.09190421  0.55784431\n",
      "   0.30983715  1.65724622  0.32598698  1.35269884  0.31059209  1.65724622\n",
      "   0.11227851 -0.20126085  0.68589797  0.09190421  1.44168119  1.81863893\n",
      "   0.0467463   0.14844444 -0.83142054  1.38652227  0.09190421 -1.2788429\n",
      "   0.46886196  1.34702881 -0.52687316  0.68589797  0.77340934  1.35269884\n",
      "   0.52687316  0.08170411  1.28028848  0.05241634  0.66552368  1.54224495\n",
      "   0.50268539 -0.53306069  1.04248143 -0.53306069  1.44168119 -0.83142054\n",
      "   0.57966417  0.77907938  0.42370405  0.77340934  0.37568056  1.04248143\n",
      "  -0.99044535  0.09190421 -0.22851331  0.9757411   1.35269884  0.11227851\n",
      "   0.51268639  1.44168119  2.12318631  0.66552368  0.32169471  0.93480205\n",
      "   1.04248143 -1.35015164  1.35269884 -0.14991542  0.97007106  1.28028848\n",
      "  -0.25780108  0.35696372  0.19813801  0.99044535  0.68589797  0.40212163\n",
      "   1.35269884 -1.15183806 -0.52687316  0.0467463   1.65724622  0.93480205\n",
      "   0.77907938  0.9757411  -0.24928435 -1.45638544  1.65724622  0.23742679\n",
      "   0.86239169  1.50842152  1.04248143 -0.12227951  1.54791499  1.44168119\n",
      "  -0.88276598  0.23742679  1.28028848  1.8129689   0.97007106  1.35269884\n",
      "   1.23934943  0.9757411   1.34702881 -0.23742679  0.68589797  0.70666901\n",
      "  -0.4544628   0.77340934  0.03911321  1.35269884  1.65724622  0.14844444\n",
      "  -0.50649887  1.04248143 -0.53306069 -0.06712059 -0.53306069 -0.653878\n",
      "   0.68589797  1.23934943 -1.12126367 -0.36548045 -0.52687316 -0.52687316\n",
      "   0.68589797 -1.2788429   1.23934943  1.23934943 -0.53306069  0.77907938\n",
      "   0.70666901  0.77907938  0.70666901  0.77175748 -0.14424538  1.81863893\n",
      "  -1.45638544  0.46886196  1.44168119  0.14844444 -0.22284327  1.24501947\n",
      "   0.09190421  1.34702881 -0.14991542  0.68589797  1.65724622  0.0467463\n",
      "  -0.52687316  0.31602468  0.68589797  0.23742679  1.28028848  0.19813801\n",
      "   0.09190421  0.77340934  0.97007106  1.08362676  1.65724622  0.68589797\n",
      "  -0.51268639  1.04248143  0.97007106 -0.52120313  0.86806172 -0.22851331\n",
      "   0.77340934  1.35269884  1.65724622 -0.53306069  0.68589797 -1.15183806\n",
      "   0.81290281 -0.52120313 -1.45638544  0.68589797  0.39645159  0.66552368\n",
      "  -0.20126085  1.35269884  1.04248143  0.39645159  0.05097077 -1.45638544\n",
      "   1.04248143  0.42370405  0.77907938  0.46886196 -1.45638544 -0.52687316\n",
      "  -0.52687316 -0.14991542  1.65724622 -0.53306069  0.66552368  0.09190421\n",
      "  -0.83142054 -0.36548045 -0.14424538  1.24501947 -0.53306069  1.65724622\n",
      "   0.08170411  0.62459023  1.2611693   0.11227851 -0.42063936  0.97007106\n",
      "   0.70666901  0.46886196  0.66552368  1.0819749   0.77907938  0.70666901\n",
      "  -0.52687316 -0.52687316 -1.45638544  0.50835543 -0.4544628   0.82290381\n",
      "   1.34702881  1.35269884  0.70666901  1.54791499 -0.53306069 -0.22851331\n",
      "   0.11227851  1.65724622  1.08362676 -0.91728005  0.11227851  0.68589797\n",
      "   1.0819749   1.04248143 -0.22851331 -0.4544628   0.39645159  1.81863893\n",
      "  -0.06712059 -0.52687316 -1.15183806  0.39645159  0.68589797]]\n",
      "total error:  0.247491638796\n",
      "D: [[ 0.00264962  0.00866853  0.00157324  0.00489163  0.00195955  0.0011602\n",
      "   0.00115364  0.00904571  0.00263464  0.00380121  0.00300167  0.002792\n",
      "   0.00085076  0.00967002  0.00138128  0.00263464  0.00141027  0.00224729\n",
      "   0.002792    0.00760406  0.00518379  0.00085076  0.00157324  0.00168426\n",
      "   0.00188368  0.00398821  0.00300167  0.00168183  0.00885975  0.00072396\n",
      "   0.00141027  0.00489163  0.00150983  0.00204734  0.00755715  0.00104002\n",
      "   0.0036608   0.00792177  0.00115364  0.00499231  0.00104002  0.00398821\n",
      "   0.0040703   0.00309609  0.00224729  0.00104002  0.01411812  0.00115364\n",
      "   0.00355057  0.00104002  0.00157324  0.00713123  0.00157324  0.00224729\n",
      "   0.00484199  0.0066331   0.00224729  0.0038409   0.00250278  0.00104002\n",
      "   0.00157324  0.00150983  0.00348333  0.00417244  0.0040703   0.0025543\n",
      "   0.00327325  0.00085076  0.00322081  0.00115364  0.00608735  0.00085076\n",
      "   0.00499231  0.00364866  0.00885975  0.00489163  0.00105542  0.00072396\n",
      "   0.00467565  0.00384655  0.00194294  0.00111527  0.0040703   0.00124207\n",
      "   0.002792    0.0011602   0.00263464  0.00885975  0.00205898  0.00115364\n",
      "   0.00263464  0.00484199  0.00124027  0.00470223  0.00229354  0.00095445\n",
      "   0.00269915  0.00261839  0.00157324  0.00760406  0.00105542  0.00194294\n",
      "   0.00249917  0.00204734  0.00681636  0.00205898  0.00306467  0.00157324\n",
      "   0.00165728  0.00489163  0.00355057  0.00168183  0.00115364  0.00499231\n",
      "   0.00267229  0.00105542  0.00053389  0.00868107  0.00323467  0.00175211\n",
      "   0.00157324  0.00115658  0.00115364  0.0038409   0.01177163  0.00124027\n",
      "   0.00577433  0.00312257  0.00543989  0.00165728  0.00885975  0.00667082\n",
      "   0.00115364  0.00141027  0.00263464  0.00467565  0.00085076  0.00175211\n",
      "   0.00204734  0.00168183  0.00347758  0.00104002  0.00085076  0.00565787\n",
      "   0.00188368  0.00098728  0.01265563  0.00504249  0.00094905  0.00105542\n",
      "   0.00184569  0.00351906  0.00124027  0.00072808  0.00169139  0.00115364\n",
      "   0.01540929  0.00168183  0.0011602   0.00565787  0.00885975  0.00220109\n",
      "   0.0028325   0.00205898  0.00464009  0.00115364  0.00085076  0.00384655\n",
      "   0.00268887  0.00157324  0.00261839  0.00477189  0.00261839  0.00232041\n",
      "   0.00224729  0.0012921   0.00145406  0.00643082  0.00263464  0.00263464\n",
      "   0.00224729  0.00124207  0.0012921   0.0012921   0.00760406  0.00204734\n",
      "   0.00220109  0.00204734  0.00220109  0.00206239  0.00515448  0.00072396\n",
      "   0.00104002  0.002792    0.00105542  0.00517617  0.00357076  0.0012848\n",
      "   0.0040703   0.0011602   0.0038409   0.00885975  0.00085076  0.00425832\n",
      "   0.00263464  0.00325306  0.00885975  0.00565787  0.00124027  0.00543989\n",
      "   0.00489163  0.00205898  0.00169139  0.00150983  0.00085076  0.00224729\n",
      "   0.0074507   0.01265563  0.00169139  0.00264962  0.00187303  0.00560767\n",
      "   0.00205898  0.00115364  0.00085076  0.00261839  0.00224729  0.00141027\n",
      "   0.00197925  0.00751442  0.00104002  0.00224729  0.00300167  0.00229354\n",
      "   0.00364866  0.00115364  0.00157324  0.0066331   0.00469544  0.00104002\n",
      "   0.00157324  0.00681636  0.00204734  0.002792    0.00104002  0.00755715\n",
      "   0.00263464  0.00518379  0.00085076  0.00261839  0.00868107  0.00489163\n",
      "   0.01024758  0.00643082  0.00386274  0.01549691  0.00261839  0.00085076\n",
      "   0.00484199  0.00238937  0.00126422  0.00398821  0.00292994  0.00169139\n",
      "   0.00904571  0.002792    0.00229354  0.00151232  0.00204734  0.00904571\n",
      "   0.00755715  0.00755715  0.00104002  0.0074185   0.0028325   0.01016068\n",
      "   0.0011602   0.00115364  0.00220109  0.00094905  0.00261839  0.00355057\n",
      "   0.00398821  0.00085076  0.00150983  0.00178308  0.00398821  0.00224729\n",
      "   0.00151232  0.00157324  0.00355057  0.0028325   0.0066331   0.00072396\n",
      "   0.00417244  0.00263464  0.00141027  0.00300167  0.00885975]]\n",
      "classEst:  [[-1. -1. -1.  1.  1. -1. -1. -1.  1. -1. -1.  1. -1. -1. -1.  1.  1. -1.\n",
      "  -1.  1.  1. -1.  1.  1. -1.  1.  1. -1. -1. -1.  1. -1. -1. -1.  1. -1.\n",
      "  -1. -1. -1.  1. -1.  1. -1. -1. -1. -1. -1. -1.  1.  1. -1.  1. -1. -1.\n",
      "   1. -1. -1.  1. -1. -1.  1. -1. -1. -1.  1.  1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1. -1. -1. -1.  1. -1.  1. -1.  1.  1.  1. -1.  1. -1.\n",
      "  -1.  1. -1. -1.  1. -1.  1.  1.  1.  1. -1. -1. -1.  1. -1.  1.  1.  1.\n",
      "   1.  1. -1. -1. -1. -1. -1.  1. -1. -1.  1. -1.  1.  1. -1. -1. -1.  1.\n",
      "  -1.  1. -1. -1. -1.  1. -1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1.  1.\n",
      "   1. -1. -1. -1. -1. -1. -1. -1. -1.  1. -1. -1. -1.  1. -1. -1. -1. -1.\n",
      "  -1. -1.  1. -1. -1.  1. -1. -1. -1.  1. -1. -1. -1.  1. -1.  1. -1.  1.\n",
      "  -1. -1. -1.  1.  1.  1.  1. -1. -1. -1.  1. -1.  1. -1. -1. -1.  1. -1.\n",
      "   1. -1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1.\n",
      "  -1.  1. -1.  1.  1. -1. -1. -1. -1. -1. -1.  1.  1.  1. -1. -1.  1.  1.\n",
      "  -1. -1.  1. -1. -1.  1. -1.  1. -1.  1. -1.  1. -1.  1. -1.  1. -1.  1.\n",
      "  -1. -1.  1. -1. -1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1. -1.  1.  1.\n",
      "  -1.  1. -1. -1.  1. -1.  1. -1.  1. -1. -1. -1. -1. -1. -1. -1.  1. -1.\n",
      "   1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1.]]\n",
      "aggClassEst:  [[-0.646419    0.53886223  0.91726555  0.21712009 -0.69768794  1.22181293\n",
      "   1.22748297  0.58145314 -0.40165729  0.03508613  0.27123572  0.59407783\n",
      "   1.53203035  0.64819347  1.04739323 -0.40165729 -1.02662219  0.5606821\n",
      "   0.34364609 -0.40784481 -0.02469954  1.53203035  1.1676973   1.0995114\n",
      "   0.73717581  0.23749438  0.52166747  0.85052522  0.5606821   1.69342306\n",
      "  -1.02662219 -0.03331166  0.95841088  0.6538635  -0.40165729 -1.58160132\n",
      "  -0.32315478 -0.69921001  1.22748297  0.23749438 -1.58160132  0.23749438\n",
      "  -0.03331166 -0.49069632 -0.81111385 -1.58160132 -1.27705394  1.22748297\n",
      "  -0.10329743 -1.33116957  0.91726555  0.59407783  0.91726555  0.5606821\n",
      "   0.20691998  0.27123572  0.5606821  -0.02469954 -0.70343447 -1.58160132\n",
      "   1.1676973   0.95841088 -0.37284836 -0.19233647  0.21712009  0.68306018\n",
      "   0.18462128  1.53203035  0.20077111  1.22748297  0.18537621  1.53203035\n",
      "  -0.01293737 -0.32647673  0.5606821  -0.03331166  1.31646531  1.69342306\n",
      "  -0.07846957  0.02322857 -0.70620467  1.2613064   0.21712009 -1.40405878\n",
      "   0.59407783  1.47224468 -0.40165729  0.5606821   0.89862521  1.22748297\n",
      "   0.40165729  0.20691998  1.1550726  -0.07279954  0.79073955  1.41702908\n",
      "   0.62790127 -0.40784481  1.1676973  -0.40784481  1.31646531 -0.95663642\n",
      "   0.4544483   0.90429525  0.29848817  0.89862521  0.50089643  1.1676973\n",
      "  -0.86522948  0.21712009 -0.35372918  0.85052522  1.22748297 -0.01293737\n",
      "   0.38747052  1.56689706  1.99797044  0.54030781  0.44691059  0.80958618\n",
      "   1.1676973  -1.22493577  1.22748297 -0.27513129  0.84485519  1.40550435\n",
      "  -0.38301695  0.48217959  0.07292214  0.86522948  0.5606821   0.5273375\n",
      "   1.22748297 -1.27705394 -0.40165729 -0.07846957  1.53203035  0.80958618\n",
      "   0.90429525  0.85052522 -0.12406847 -1.58160132  1.53203035  0.36264266\n",
      "   0.98760756  1.38320565  0.91726555 -0.24749538  1.42269911  1.31646531\n",
      "  -1.00798185  0.11221091  1.1550726   1.93818477  0.84485519  1.22748297\n",
      "   1.11413356  1.10095697  1.22181293 -0.36264266  0.5606821   0.58145314\n",
      "  -0.57967867  0.64819347  0.16432908  1.22748297  1.53203035  0.27366031\n",
      "  -0.63171474  0.91726555 -0.65827656  0.05809528 -0.65827656 -0.77909388\n",
      "   0.5606821   1.36456531 -1.24647954 -0.24026458 -0.65208904 -0.40165729\n",
      "   0.5606821  -1.40405878  1.11413356  1.36456531 -0.40784481  0.90429525\n",
      "   0.83188488  0.6538635   0.58145314  0.64654161 -0.01902951  1.69342306\n",
      "  -1.33116957  0.34364609  1.31646531  0.02322857 -0.0976274   1.1198036\n",
      "   0.21712009  1.22181293 -0.27513129  0.81111385  1.53203035 -0.07846957\n",
      "  -0.65208904  0.44124055  0.5606821   0.36264266  1.1550726   0.07292214\n",
      "  -0.03331166  0.89862521  0.84485519  1.20884263  1.53203035  0.5606821\n",
      "  -0.63790227  1.1676973   0.84485519 -0.39598725  0.9932776  -0.35372918\n",
      "   0.64819347  1.22748297  1.53203035 -0.65827656  0.5606821  -1.02662219\n",
      "   0.93811868 -0.39598725 -1.58160132  0.5606821   0.52166747  0.79073955\n",
      "  -0.32647673  1.22748297  1.1676973   0.27123572 -0.07424511 -1.33116957\n",
      "   0.91726555  0.54891992  0.6538635   0.59407783 -1.58160132 -0.40165729\n",
      "  -0.65208904 -0.02469954  1.53203035 -0.40784481  0.54030781  0.21712009\n",
      "  -0.95663642 -0.49069632 -0.01902951  1.1198036  -0.65827656  1.53203035\n",
      "   0.20691998  0.49937436  1.13595343 -0.01293737 -0.29542349  0.84485519\n",
      "   0.83188488  0.34364609  0.54030781  0.95675902  0.90429525  0.83188488\n",
      "  -0.65208904 -0.40165729 -1.58160132  0.38313956 -0.32924692  0.69768794\n",
      "   1.47224468  1.22748297  0.83188488  1.42269911 -0.65827656 -0.35372918\n",
      "  -0.01293737  1.53203035  0.95841088 -1.04249592  0.23749438  0.5606821\n",
      "   1.20719077  0.91726555 -0.10329743 -0.57967867  0.27123572  1.69342306\n",
      "   0.05809528 -0.65208904 -1.02662219  0.27123572  0.5606821 ]]\n",
      "total error:  0.230769230769\n"
     ]
    }
   ],
   "source": [
    "datArr, labelArr = loadDataSet('./horseColicTraining2.txt')\n",
    "classifierArray, aggClassEstArr = adaBoostTrainDS(datArr, labelArr, 10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [-0.46166238]\n",
      " [-0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [-0.46166238]\n",
      " [-0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [-0.46166238]\n",
      " [-0.46166238]\n",
      " [-0.46166238]\n",
      " [-0.46166238]\n",
      " [ 0.46166238]\n",
      " [-0.46166238]\n",
      " [-0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [-0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [-0.46166238]\n",
      " [ 0.46166238]\n",
      " [-0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [-0.46166238]\n",
      " [ 0.46166238]\n",
      " [-0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [-0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]]\n",
      "[[ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [-0.14917993]\n",
      " [-0.14917993]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.14917993]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.14917993]\n",
      " [ 0.14917993]\n",
      " [-0.14917993]\n",
      " [-0.14917993]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [-0.14917993]\n",
      " [-0.14917993]\n",
      " [-0.77414483]\n",
      " [-0.14917993]\n",
      " [ 0.77414483]\n",
      " [-0.14917993]\n",
      " [-0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.14917993]\n",
      " [-0.14917993]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.14917993]\n",
      " [ 0.14917993]\n",
      " [ 0.77414483]\n",
      " [-0.14917993]\n",
      " [ 0.77414483]\n",
      " [-0.14917993]\n",
      " [ 0.14917993]\n",
      " [ 0.14917993]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.14917993]\n",
      " [-0.14917993]\n",
      " [ 0.77414483]\n",
      " [-0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.14917993]\n",
      " [-0.14917993]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]]\n",
      "[[ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 0.1376298 ]\n",
      " [-0.43598966]\n",
      " [ 1.06095456]\n",
      " [ 0.4873351 ]\n",
      " [-0.1376298 ]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [-0.1376298 ]\n",
      " [-0.1376298 ]\n",
      " [-0.43598966]\n",
      " [-0.43598966]\n",
      " [ 0.4873351 ]\n",
      " [ 0.4873351 ]\n",
      " [ 0.4873351 ]\n",
      " [ 1.06095456]\n",
      " [-0.43598966]\n",
      " [-0.43598966]\n",
      " [-1.06095456]\n",
      " [-0.43598966]\n",
      " [ 1.06095456]\n",
      " [-0.43598966]\n",
      " [-1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 0.4873351 ]\n",
      " [ 1.06095456]\n",
      " [ 0.4873351 ]\n",
      " [ 1.06095456]\n",
      " [-0.1376298 ]\n",
      " [-0.43598966]\n",
      " [ 0.4873351 ]\n",
      " [ 0.4873351 ]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 0.4873351 ]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [-0.1376298 ]\n",
      " [-0.1376298 ]\n",
      " [ 0.4873351 ]\n",
      " [-0.43598966]\n",
      " [ 1.06095456]\n",
      " [ 0.1376298 ]\n",
      " [-0.1376298 ]\n",
      " [-0.1376298 ]\n",
      " [ 0.4873351 ]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 0.43598966]\n",
      " [ 0.1376298 ]\n",
      " [ 0.4873351 ]\n",
      " [-1.06095456]\n",
      " [ 1.06095456]\n",
      " [-0.1376298 ]\n",
      " [-0.43598966]\n",
      " [ 1.06095456]\n",
      " [ 0.4873351 ]\n",
      " [ 1.06095456]\n",
      " [ 0.4873351 ]]\n",
      "[[ 0.82798452]\n",
      " [ 0.82798452]\n",
      " [ 0.37059985]\n",
      " [-0.66895971]\n",
      " [ 0.82798452]\n",
      " [ 0.72030514]\n",
      " [-0.37059985]\n",
      " [ 0.82798452]\n",
      " [ 0.82798452]\n",
      " [-0.37059985]\n",
      " [-0.37059985]\n",
      " [-0.20301961]\n",
      " [-0.66895971]\n",
      " [ 0.25436505]\n",
      " [ 0.25436505]\n",
      " [ 0.25436505]\n",
      " [ 0.82798452]\n",
      " [-0.66895971]\n",
      " [-0.66895971]\n",
      " [-0.82798452]\n",
      " [-0.66895971]\n",
      " [ 0.82798452]\n",
      " [-0.66895971]\n",
      " [-1.29392461]\n",
      " [ 1.29392461]\n",
      " [ 0.82798452]\n",
      " [ 1.29392461]\n",
      " [ 0.25436505]\n",
      " [ 0.82798452]\n",
      " [ 0.25436505]\n",
      " [ 0.82798452]\n",
      " [-0.37059985]\n",
      " [-0.66895971]\n",
      " [ 0.25436505]\n",
      " [ 0.25436505]\n",
      " [ 0.82798452]\n",
      " [ 0.82798452]\n",
      " [ 0.82798452]\n",
      " [ 0.82798452]\n",
      " [ 0.72030514]\n",
      " [ 0.82798452]\n",
      " [ 0.82798452]\n",
      " [ 0.82798452]\n",
      " [-0.37059985]\n",
      " [-0.37059985]\n",
      " [ 0.25436505]\n",
      " [-0.66895971]\n",
      " [ 0.82798452]\n",
      " [ 0.37059985]\n",
      " [ 0.09534024]\n",
      " [-0.37059985]\n",
      " [ 0.72030514]\n",
      " [ 1.29392461]\n",
      " [ 0.82798452]\n",
      " [ 0.82798452]\n",
      " [ 0.82798452]\n",
      " [ 0.66895971]\n",
      " [-0.09534024]\n",
      " [ 0.72030514]\n",
      " [-1.29392461]\n",
      " [ 0.82798452]\n",
      " [-0.37059985]\n",
      " [-0.66895971]\n",
      " [ 0.82798452]\n",
      " [ 0.72030514]\n",
      " [ 0.82798452]\n",
      " [ 0.25436505]]\n",
      "[[ 1.02602298]\n",
      " [ 1.02602298]\n",
      " [ 0.56863831]\n",
      " [-0.47092125]\n",
      " [ 0.62994605]\n",
      " [ 0.91834361]\n",
      " [-0.17256139]\n",
      " [ 0.62994605]\n",
      " [ 1.02602298]\n",
      " [-0.17256139]\n",
      " [-0.17256139]\n",
      " [-0.00498115]\n",
      " [-0.47092125]\n",
      " [ 0.05632659]\n",
      " [ 0.45240351]\n",
      " [ 0.45240351]\n",
      " [ 1.02602298]\n",
      " [-0.47092125]\n",
      " [-0.47092125]\n",
      " [-0.62994605]\n",
      " [-0.47092125]\n",
      " [ 1.02602298]\n",
      " [-0.47092125]\n",
      " [-1.09588615]\n",
      " [ 1.49196307]\n",
      " [ 1.02602298]\n",
      " [ 1.49196307]\n",
      " [ 0.45240351]\n",
      " [ 1.02602298]\n",
      " [ 0.45240351]\n",
      " [ 1.02602298]\n",
      " [-0.17256139]\n",
      " [-0.47092125]\n",
      " [ 0.05632659]\n",
      " [ 0.05632659]\n",
      " [ 1.02602298]\n",
      " [ 1.02602298]\n",
      " [ 1.02602298]\n",
      " [ 1.02602298]\n",
      " [ 0.91834361]\n",
      " [ 1.02602298]\n",
      " [ 1.02602298]\n",
      " [ 1.02602298]\n",
      " [-0.17256139]\n",
      " [-0.56863831]\n",
      " [ 0.45240351]\n",
      " [-0.47092125]\n",
      " [ 1.02602298]\n",
      " [ 0.56863831]\n",
      " [ 0.2933787 ]\n",
      " [-0.17256139]\n",
      " [ 0.91834361]\n",
      " [ 1.49196307]\n",
      " [ 1.02602298]\n",
      " [ 0.62994605]\n",
      " [ 1.02602298]\n",
      " [ 0.86699817]\n",
      " [ 0.10269822]\n",
      " [ 0.91834361]\n",
      " [-1.09588615]\n",
      " [ 1.02602298]\n",
      " [-0.17256139]\n",
      " [-0.47092125]\n",
      " [ 1.02602298]\n",
      " [ 0.91834361]\n",
      " [ 1.02602298]\n",
      " [ 0.45240351]]\n",
      "[[ 1.21450185]\n",
      " [ 1.21450185]\n",
      " [ 0.75711718]\n",
      " [-0.65940012]\n",
      " [ 0.44146718]\n",
      " [ 0.72986473]\n",
      " [-0.36104026]\n",
      " [ 0.81842493]\n",
      " [ 0.8375441 ]\n",
      " [-0.36104026]\n",
      " [-0.36104026]\n",
      " [ 0.18349772]\n",
      " [-0.65940012]\n",
      " [ 0.24480546]\n",
      " [ 0.64088239]\n",
      " [ 0.64088239]\n",
      " [ 0.8375441 ]\n",
      " [-0.28244237]\n",
      " [-0.65940012]\n",
      " [-0.44146718]\n",
      " [-0.65940012]\n",
      " [ 0.8375441 ]\n",
      " [-0.65940012]\n",
      " [-1.28436502]\n",
      " [ 1.68044194]\n",
      " [ 1.21450185]\n",
      " [ 1.68044194]\n",
      " [ 0.64088239]\n",
      " [ 1.21450185]\n",
      " [ 0.64088239]\n",
      " [ 1.21450185]\n",
      " [-0.36104026]\n",
      " [-0.28244237]\n",
      " [ 0.24480546]\n",
      " [-0.13215228]\n",
      " [ 0.8375441 ]\n",
      " [ 1.21450185]\n",
      " [ 1.21450185]\n",
      " [ 1.21450185]\n",
      " [ 0.72986473]\n",
      " [ 0.8375441 ]\n",
      " [ 1.21450185]\n",
      " [ 1.21450185]\n",
      " [-0.36104026]\n",
      " [-0.38015944]\n",
      " [ 0.26392464]\n",
      " [-0.65940012]\n",
      " [ 0.8375441 ]\n",
      " [ 0.38015944]\n",
      " [ 0.10489983]\n",
      " [-0.36104026]\n",
      " [ 1.10682248]\n",
      " [ 1.68044194]\n",
      " [ 1.21450185]\n",
      " [ 0.81842493]\n",
      " [ 0.8375441 ]\n",
      " [ 0.6785193 ]\n",
      " [-0.08578066]\n",
      " [ 1.10682248]\n",
      " [-0.90740727]\n",
      " [ 0.8375441 ]\n",
      " [-0.36104026]\n",
      " [-0.28244237]\n",
      " [ 1.21450185]\n",
      " [ 1.10682248]\n",
      " [ 0.8375441 ]\n",
      " [ 0.26392464]]\n",
      "[[ 1.36677554]\n",
      " [ 1.06222816]\n",
      " [ 0.60484349]\n",
      " [-0.81167381]\n",
      " [ 0.28919349]\n",
      " [ 0.88213842]\n",
      " [-0.20876657]\n",
      " [ 0.97069862]\n",
      " [ 0.98981779]\n",
      " [-0.51331395]\n",
      " [-0.20876657]\n",
      " [ 0.03122403]\n",
      " [-0.50712643]\n",
      " [ 0.39707915]\n",
      " [ 0.79315608]\n",
      " [ 0.79315608]\n",
      " [ 0.68527041]\n",
      " [-0.43471606]\n",
      " [-0.81167381]\n",
      " [-0.59374087]\n",
      " [-0.50712643]\n",
      " [ 0.98981779]\n",
      " [-0.50712643]\n",
      " [-1.43663871]\n",
      " [ 1.52816825]\n",
      " [ 1.06222816]\n",
      " [ 1.83271563]\n",
      " [ 0.4886087 ]\n",
      " [ 1.06222816]\n",
      " [ 0.4886087 ]\n",
      " [ 1.36677554]\n",
      " [-0.20876657]\n",
      " [-0.43471606]\n",
      " [ 0.09253177]\n",
      " [-0.28442597]\n",
      " [ 0.68527041]\n",
      " [ 1.06222816]\n",
      " [ 1.06222816]\n",
      " [ 1.06222816]\n",
      " [ 0.88213842]\n",
      " [ 0.98981779]\n",
      " [ 1.36677554]\n",
      " [ 1.06222816]\n",
      " [-0.51331395]\n",
      " [-0.53243313]\n",
      " [ 0.11165095]\n",
      " [-0.50712643]\n",
      " [ 0.68527041]\n",
      " [ 0.22788575]\n",
      " [-0.04737386]\n",
      " [-0.51331395]\n",
      " [ 0.95454879]\n",
      " [ 1.52816825]\n",
      " [ 1.06222816]\n",
      " [ 0.66615124]\n",
      " [ 0.98981779]\n",
      " [ 0.52624561]\n",
      " [-0.23805435]\n",
      " [ 1.25909617]\n",
      " [-1.05968096]\n",
      " [ 0.98981779]\n",
      " [-0.51331395]\n",
      " [-0.43471606]\n",
      " [ 1.06222816]\n",
      " [ 0.95454879]\n",
      " [ 0.68527041]\n",
      " [ 0.11165095]]\n",
      "[[ 1.21166683]\n",
      " [ 1.21733687]\n",
      " [ 0.44973479]\n",
      " [-0.96678252]\n",
      " [ 0.13408478]\n",
      " [ 1.03724713]\n",
      " [-0.36387528]\n",
      " [ 0.81558991]\n",
      " [ 0.83470909]\n",
      " [-0.66842266]\n",
      " [-0.36387528]\n",
      " [-0.12388468]\n",
      " [-0.66223514]\n",
      " [ 0.24197045]\n",
      " [ 0.63804737]\n",
      " [ 0.94826478]\n",
      " [ 0.84037912]\n",
      " [-0.58982477]\n",
      " [-0.96678252]\n",
      " [-0.74884958]\n",
      " [-0.66223514]\n",
      " [ 0.83470909]\n",
      " [-0.66223514]\n",
      " [-1.59174742]\n",
      " [ 1.68327696]\n",
      " [ 0.90711945]\n",
      " [ 1.67760692]\n",
      " [ 0.33349999]\n",
      " [ 1.21733687]\n",
      " [ 0.6437174 ]\n",
      " [ 1.52188425]\n",
      " [-0.36387528]\n",
      " [-0.58982477]\n",
      " [-0.06257693]\n",
      " [-0.43953468]\n",
      " [ 0.84037912]\n",
      " [ 1.21733687]\n",
      " [ 1.21733687]\n",
      " [ 0.90711945]\n",
      " [ 0.72702971]\n",
      " [ 0.83470909]\n",
      " [ 1.21166683]\n",
      " [ 0.90711945]\n",
      " [-0.66842266]\n",
      " [-0.68754184]\n",
      " [-0.04345776]\n",
      " [-0.66223514]\n",
      " [ 0.84037912]\n",
      " [ 0.38299446]\n",
      " [-0.20248257]\n",
      " [-0.66842266]\n",
      " [ 0.79944008]\n",
      " [ 1.37305954]\n",
      " [ 1.21733687]\n",
      " [ 0.82125995]\n",
      " [ 1.1449265 ]\n",
      " [ 0.68135431]\n",
      " [-0.39316305]\n",
      " [ 1.10398746]\n",
      " [-1.21478967]\n",
      " [ 1.1449265 ]\n",
      " [-0.66842266]\n",
      " [-0.58982477]\n",
      " [ 1.21733687]\n",
      " [ 0.79944008]\n",
      " [ 0.53016171]\n",
      " [ 0.26675966]]\n",
      "[[ 1.07630486]\n",
      " [ 1.0819749 ]\n",
      " [ 0.31437281]\n",
      " [-0.83142054]\n",
      " [ 0.26944676]\n",
      " [ 1.1726091 ]\n",
      " [-0.22851331]\n",
      " [ 0.95095188]\n",
      " [ 0.97007106]\n",
      " [-0.53306069]\n",
      " [-0.22851331]\n",
      " [-0.25924665]\n",
      " [-0.52687316]\n",
      " [ 0.37733242]\n",
      " [ 0.77340934]\n",
      " [ 1.08362676]\n",
      " [ 0.9757411 ]\n",
      " [-0.4544628 ]\n",
      " [-0.83142054]\n",
      " [-0.88421155]\n",
      " [-0.52687316]\n",
      " [ 0.97007106]\n",
      " [-0.52687316]\n",
      " [-1.45638544]\n",
      " [ 1.81863893]\n",
      " [ 1.04248143]\n",
      " [ 1.8129689 ]\n",
      " [ 0.46886196]\n",
      " [ 1.35269884]\n",
      " [ 0.50835543]\n",
      " [ 1.65724622]\n",
      " [-0.22851331]\n",
      " [-0.4544628 ]\n",
      " [-0.19793891]\n",
      " [-0.30417271]\n",
      " [ 0.9757411 ]\n",
      " [ 1.35269884]\n",
      " [ 1.35269884]\n",
      " [ 1.04248143]\n",
      " [ 0.86239169]\n",
      " [ 0.97007106]\n",
      " [ 1.34702881]\n",
      " [ 1.04248143]\n",
      " [-0.53306069]\n",
      " [-0.55217986]\n",
      " [ 0.09190421]\n",
      " [-0.52687316]\n",
      " [ 0.9757411 ]\n",
      " [ 0.51835643]\n",
      " [-0.06712059]\n",
      " [-0.53306069]\n",
      " [ 0.93480205]\n",
      " [ 1.50842152]\n",
      " [ 1.35269884]\n",
      " [ 0.68589797]\n",
      " [ 1.28028848]\n",
      " [ 0.81671629]\n",
      " [-0.25780108]\n",
      " [ 1.23934943]\n",
      " [-1.0794277 ]\n",
      " [ 1.28028848]\n",
      " [-0.53306069]\n",
      " [-0.4544628 ]\n",
      " [ 1.35269884]\n",
      " [ 0.93480205]\n",
      " [ 0.66552368]\n",
      " [ 0.40212163]]\n",
      "[[ 0.95108899]\n",
      " [ 1.20719077]\n",
      " [ 0.18915694]\n",
      " [-0.95663642]\n",
      " [ 0.14423088]\n",
      " [ 1.29782498]\n",
      " [-0.10329743]\n",
      " [ 0.82573601]\n",
      " [ 1.09528693]\n",
      " [-0.65827656]\n",
      " [-0.35372918]\n",
      " [-0.38446252]\n",
      " [-0.40165729]\n",
      " [ 0.50254829]\n",
      " [ 0.64819347]\n",
      " [ 1.20884263]\n",
      " [ 0.85052522]\n",
      " [-0.57967867]\n",
      " [-0.70620467]\n",
      " [-0.75899568]\n",
      " [-0.65208904]\n",
      " [ 1.09528693]\n",
      " [-0.40165729]\n",
      " [-1.33116957]\n",
      " [ 1.69342306]\n",
      " [ 1.1676973 ]\n",
      " [ 1.68775303]\n",
      " [ 0.34364609]\n",
      " [ 1.22748297]\n",
      " [ 0.38313956]\n",
      " [ 1.53203035]\n",
      " [-0.35372918]\n",
      " [-0.57967867]\n",
      " [-0.32315478]\n",
      " [-0.17895684]\n",
      " [ 0.85052522]\n",
      " [ 1.22748297]\n",
      " [ 1.22748297]\n",
      " [ 0.91726555]\n",
      " [ 0.98760756]\n",
      " [ 0.84485519]\n",
      " [ 1.47224468]\n",
      " [ 0.91726555]\n",
      " [-0.65827656]\n",
      " [-0.67739574]\n",
      " [ 0.21712009]\n",
      " [-0.40165729]\n",
      " [ 0.85052522]\n",
      " [ 0.39314056]\n",
      " [ 0.05809528]\n",
      " [-0.40784481]\n",
      " [ 0.80958618]\n",
      " [ 1.63363739]\n",
      " [ 1.22748297]\n",
      " [ 0.81111385]\n",
      " [ 1.1550726 ]\n",
      " [ 0.69150041]\n",
      " [-0.38301695]\n",
      " [ 1.11413356]\n",
      " [-1.20464357]\n",
      " [ 1.1550726 ]\n",
      " [-0.40784481]\n",
      " [-0.32924692]\n",
      " [ 1.47791472]\n",
      " [ 0.80958618]\n",
      " [ 0.54030781]\n",
      " [ 0.5273375 ]]\n"
     ]
    }
   ],
   "source": [
    "testArr, testLabelArr = loadDataSet('./horseColicTest2.txt')\n",
    "prediction10 = adaClassify(testArr, classifierArray)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "16.0"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "errArr = np.mat(np.ones((67, 1)))\n",
    "errArr[prediction10 != np.mat(testLabelArr).T].sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
